/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('trademark', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BindApplicantRequest {
  applicantId?: string(name='ApplicantId', example='123456789'),
  authorizationOssKey?: string(name='AuthorizationOssKey', example='1234567890/attorney/asdfghjkl.jpg'),
  bizId?: string(name='BizId', example='trademark_register-cn-123456789'),
}

model BindApplicantResponseBody = {
  requestId?: string(name='RequestId', example='c188240f-a7f9-467f-ada8-34b354492019'),
}

model BindApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindApplicantResponseBody(name='body'),
}

async function bindApplicantWithOptions(request: BindApplicantRequest, runtime: Util.RuntimeOptions): BindApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindApplicant(request: BindApplicantRequest): BindApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindApplicantWithOptions(request, runtime);
}

model CancelOrderRequest {
  orderId?: long(name='OrderId'),
}

model CancelOrderResponseBody = {
  requestId?: string(name='RequestId'),
}

model CancelOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelOrderResponseBody(name='body'),
}

async function cancelOrderWithOptions(request: CancelOrderRequest, runtime: Util.RuntimeOptions): CancelOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelOrder',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelOrder(request: CancelOrderRequest): CancelOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelOrderWithOptions(request, runtime);
}

model CheckAuthorizationLetterRequest {
  applicantType?: string(name='ApplicantType'),
  color?: string(name='Color'),
  contactName?: string(name='ContactName'),
  contactNumber?: string(name='ContactNumber'),
  contactZipcode?: string(name='ContactZipcode'),
  ossKey?: string(name='OssKey'),
  personalType?: string(name='PersonalType'),
  type?: string(name='Type'),
}

model CheckAuthorizationLetterResponseBody = {
  requestId?: string(name='RequestId'),
  templateUrl?: string(name='TemplateUrl'),
  tips?: string(name='Tips'),
}

model CheckAuthorizationLetterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckAuthorizationLetterResponseBody(name='body'),
}

async function checkAuthorizationLetterWithOptions(request: CheckAuthorizationLetterRequest, runtime: Util.RuntimeOptions): CheckAuthorizationLetterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantType)) {
    query['ApplicantType'] = request.applicantType;
  }
  if (!Util.isUnset(request.color)) {
    query['Color'] = request.color;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.contactNumber)) {
    query['ContactNumber'] = request.contactNumber;
  }
  if (!Util.isUnset(request.contactZipcode)) {
    query['ContactZipcode'] = request.contactZipcode;
  }
  if (!Util.isUnset(request.ossKey)) {
    query['OssKey'] = request.ossKey;
  }
  if (!Util.isUnset(request.personalType)) {
    query['PersonalType'] = request.personalType;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckAuthorizationLetter',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkAuthorizationLetter(request: CheckAuthorizationLetterRequest): CheckAuthorizationLetterResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkAuthorizationLetterWithOptions(request, runtime);
}

model CheckBizAvailableRequest {
  biz?: string(name='Biz'),
  scene?: string(name='Scene'),
}

model CheckBizAvailableResponseBody = {
  requestId?: string(name='RequestId'),
}

model CheckBizAvailableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckBizAvailableResponseBody(name='body'),
}

async function checkBizAvailableWithOptions(request: CheckBizAvailableRequest, runtime: Util.RuntimeOptions): CheckBizAvailableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.biz)) {
    query['Biz'] = request.biz;
  }
  if (!Util.isUnset(request.scene)) {
    query['Scene'] = request.scene;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckBizAvailable',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkBizAvailable(request: CheckBizAvailableRequest): CheckBizAvailableResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkBizAvailableWithOptions(request, runtime);
}

model CheckDuplicateApplicantRiskRequest {
  applicantName?: string(name='ApplicantName'),
  eventSceneType?: int32(name='EventSceneType'),
}

model CheckDuplicateApplicantRiskResponseBody = {
  requestId?: string(name='RequestId', example='33468D2D-0F4E-4234-B47D-B93E8B9E6019'),
  result?: string(name='Result', example='PASS'),
}

model CheckDuplicateApplicantRiskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDuplicateApplicantRiskResponseBody(name='body'),
}

async function checkDuplicateApplicantRiskWithOptions(request: CheckDuplicateApplicantRiskRequest, runtime: Util.RuntimeOptions): CheckDuplicateApplicantRiskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.eventSceneType)) {
    query['EventSceneType'] = request.eventSceneType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDuplicateApplicantRisk',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkDuplicateApplicantRisk(request: CheckDuplicateApplicantRiskRequest): CheckDuplicateApplicantRiskResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDuplicateApplicantRiskWithOptions(request, runtime);
}

model CheckDuplicateClassificationRequest {
  classification?: string(name='Classification', example='350071,350005,350106,350085,350120,35030010,350096,350047,350001,35020035'),
  eventSceneType?: int32(name='EventSceneType'),
  trademarkName?: string(name='TrademarkName'),
}

model CheckDuplicateClassificationResponseBody = {
  code?: string(name='Code', example='SUCCESS'),
  data?: {
    duplicateSecondaryClassification?: {
      secondaryClassification?: [ string ](name='SecondaryClassification')
    }(name='DuplicateSecondaryClassification'),
    trademarkName?: string(name='TrademarkName'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='2E3A11B4-9933-4009-842A-0687422F1BD6'),
}

model CheckDuplicateClassificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDuplicateClassificationResponseBody(name='body'),
}

async function checkDuplicateClassificationWithOptions(request: CheckDuplicateClassificationRequest, runtime: Util.RuntimeOptions): CheckDuplicateClassificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classification)) {
    query['Classification'] = request.classification;
  }
  if (!Util.isUnset(request.eventSceneType)) {
    query['EventSceneType'] = request.eventSceneType;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDuplicateClassification',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkDuplicateClassification(request: CheckDuplicateClassificationRequest): CheckDuplicateClassificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDuplicateClassificationWithOptions(request, runtime);
}

model CheckDuplicateTrademarkRequest {
  classification?: string(name='Classification'),
  eventSceneType?: int32(name='EventSceneType'),
  materialName?: string(name='MaterialName'),
  trademarkName?: string(name='TrademarkName'),
}

model CheckDuplicateTrademarkResponseBody = {
  code?: string(name='Code'),
  duplicateTrademark?: string(name='DuplicateTrademark'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  type?: string(name='Type'),
}

model CheckDuplicateTrademarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDuplicateTrademarkResponseBody(name='body'),
}

async function checkDuplicateTrademarkWithOptions(request: CheckDuplicateTrademarkRequest, runtime: Util.RuntimeOptions): CheckDuplicateTrademarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classification)) {
    query['Classification'] = request.classification;
  }
  if (!Util.isUnset(request.eventSceneType)) {
    query['EventSceneType'] = request.eventSceneType;
  }
  if (!Util.isUnset(request.materialName)) {
    query['MaterialName'] = request.materialName;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDuplicateTrademark',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkDuplicateTrademark(request: CheckDuplicateTrademarkRequest): CheckDuplicateTrademarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDuplicateTrademarkWithOptions(request, runtime);
}

model CheckMaterialValidityRequest {
  businessLicenseOssKey?: string(name='BusinessLicenseOssKey'),
  cardNumber?: string(name='CardNumber'),
  idCardName?: string(name='IdCardName'),
  idCardNumber?: string(name='IdCardNumber'),
  idCardOssKey?: string(name='IdCardOssKey'),
  materialId?: long(name='MaterialId'),
  materialRegion?: int32(name='MaterialRegion'),
  materialType?: int32(name='MaterialType'),
  name?: string(name='Name'),
  personalType?: long(name='PersonalType'),
}

model CheckMaterialValidityResponseBody = {
  requestId?: string(name='RequestId'),
}

model CheckMaterialValidityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckMaterialValidityResponseBody(name='body'),
}

async function checkMaterialValidityWithOptions(request: CheckMaterialValidityRequest, runtime: Util.RuntimeOptions): CheckMaterialValidityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessLicenseOssKey)) {
    query['BusinessLicenseOssKey'] = request.businessLicenseOssKey;
  }
  if (!Util.isUnset(request.cardNumber)) {
    query['CardNumber'] = request.cardNumber;
  }
  if (!Util.isUnset(request.idCardName)) {
    query['IdCardName'] = request.idCardName;
  }
  if (!Util.isUnset(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!Util.isUnset(request.idCardOssKey)) {
    query['IdCardOssKey'] = request.idCardOssKey;
  }
  if (!Util.isUnset(request.materialId)) {
    query['MaterialId'] = request.materialId;
  }
  if (!Util.isUnset(request.materialRegion)) {
    query['MaterialRegion'] = request.materialRegion;
  }
  if (!Util.isUnset(request.materialType)) {
    query['MaterialType'] = request.materialType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.personalType)) {
    query['PersonalType'] = request.personalType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckMaterialValidity',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkMaterialValidity(request: CheckMaterialValidityRequest): CheckMaterialValidityResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkMaterialValidityWithOptions(request, runtime);
}

model CheckTrademarkNameRequest {
  eventSceneType?: int32(name='EventSceneType'),
  trademarkName?: string(name='TrademarkName'),
}

model CheckTrademarkNameResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='30B4797C-1053-4385-A5BC-837E8EC9D8EC'),
  result?: string(name='Result', example='PASS'),
}

model CheckTrademarkNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckTrademarkNameResponseBody(name='body'),
}

async function checkTrademarkNameWithOptions(request: CheckTrademarkNameRequest, runtime: Util.RuntimeOptions): CheckTrademarkNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eventSceneType)) {
    query['EventSceneType'] = request.eventSceneType;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckTrademarkName',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkTrademarkName(request: CheckTrademarkNameRequest): CheckTrademarkNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkTrademarkNameWithOptions(request, runtime);
}

model CloseTrademarkApplicationRequest {
  bizId?: string(name='BizId', example='trademark_register-cn-78v1a67zy01'),
}

model CloseTrademarkApplicationResponseBody = {
  code?: string(name='Code', example='SUCCESS'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='30A786CD-747A-49E4-BEAB-5858C040A6A1'),
  success?: boolean(name='Success', example='true'),
}

model CloseTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloseTrademarkApplicationResponseBody(name='body'),
}

async function closeTrademarkApplicationWithOptions(request: CloseTrademarkApplicationRequest, runtime: Util.RuntimeOptions): CloseTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CloseTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function closeTrademarkApplication(request: CloseTrademarkApplicationRequest): CloseTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return closeTrademarkApplicationWithOptions(request, runtime);
}

model CombineAuthorizationLetterRequest {
  address?: string(name='Address'),
  applicantType?: string(name='ApplicantType'),
  contactName?: string(name='ContactName'),
  contactPhone?: string(name='ContactPhone'),
  contactPostcode?: string(name='ContactPostcode'),
  materialId?: string(name='MaterialId'),
  materialName?: string(name='MaterialName'),
  nationality?: string(name='Nationality'),
  personalType?: string(name='PersonalType'),
  principalName?: int32(name='PrincipalName'),
  tmProduceType?: string(name='TmProduceType'),
  trademarkName?: string(name='TrademarkName'),
}

model CombineAuthorizationLetterResponseBody = {
  requestId?: string(name='RequestId'),
  templateCombineUrl?: string(name='TemplateCombineUrl'),
}

model CombineAuthorizationLetterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CombineAuthorizationLetterResponseBody(name='body'),
}

async function combineAuthorizationLetterWithOptions(request: CombineAuthorizationLetterRequest, runtime: Util.RuntimeOptions): CombineAuthorizationLetterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.applicantType)) {
    query['ApplicantType'] = request.applicantType;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.contactPhone)) {
    query['ContactPhone'] = request.contactPhone;
  }
  if (!Util.isUnset(request.contactPostcode)) {
    query['ContactPostcode'] = request.contactPostcode;
  }
  if (!Util.isUnset(request.materialId)) {
    query['MaterialId'] = request.materialId;
  }
  if (!Util.isUnset(request.materialName)) {
    query['MaterialName'] = request.materialName;
  }
  if (!Util.isUnset(request.nationality)) {
    query['Nationality'] = request.nationality;
  }
  if (!Util.isUnset(request.personalType)) {
    query['PersonalType'] = request.personalType;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.tmProduceType)) {
    query['TmProduceType'] = request.tmProduceType;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CombineAuthorizationLetter',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function combineAuthorizationLetter(request: CombineAuthorizationLetterRequest): CombineAuthorizationLetterResponse {
  var runtime = new Util.RuntimeOptions{};
  return combineAuthorizationLetterWithOptions(request, runtime);
}

model ComplementTrademarkApplicationRequest {
  agreementId?: string(name='AgreementId'),
  authorizationOssKey?: string(name='AuthorizationOssKey'),
  bizId?: string(name='BizId'),
  isBlackIcon?: boolean(name='IsBlackIcon'),
  materialId?: string(name='MaterialId'),
  orderData?: string(name='OrderData'),
  source?: string(name='Source'),
  trademarkComment?: string(name='TrademarkComment'),
  trademarkIconOssKey?: string(name='TrademarkIconOssKey'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNameType?: string(name='TrademarkNameType'),
  trademarkType?: int32(name='TrademarkType'),
}

model ComplementTrademarkApplicationResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ComplementTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ComplementTrademarkApplicationResponseBody(name='body'),
}

async function complementTrademarkApplicationWithOptions(request: ComplementTrademarkApplicationRequest, runtime: Util.RuntimeOptions): ComplementTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agreementId)) {
    query['AgreementId'] = request.agreementId;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.isBlackIcon)) {
    query['IsBlackIcon'] = request.isBlackIcon;
  }
  if (!Util.isUnset(request.materialId)) {
    query['MaterialId'] = request.materialId;
  }
  if (!Util.isUnset(request.orderData)) {
    query['OrderData'] = request.orderData;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.trademarkComment)) {
    query['TrademarkComment'] = request.trademarkComment;
  }
  if (!Util.isUnset(request.trademarkIconOssKey)) {
    query['TrademarkIconOssKey'] = request.trademarkIconOssKey;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  if (!Util.isUnset(request.trademarkNameType)) {
    query['TrademarkNameType'] = request.trademarkNameType;
  }
  if (!Util.isUnset(request.trademarkType)) {
    query['TrademarkType'] = request.trademarkType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ComplementTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function complementTrademarkApplication(request: ComplementTrademarkApplicationRequest): ComplementTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return complementTrademarkApplicationWithOptions(request, runtime);
}

model ConfirmExpertSolutionRequest {
  bizId?: string(name='BizId'),
  note?: string(name='Note'),
}

model ConfirmExpertSolutionResponseBody = {
  requestId?: string(name='RequestId'),
}

model ConfirmExpertSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfirmExpertSolutionResponseBody(name='body'),
}

async function confirmExpertSolutionWithOptions(request: ConfirmExpertSolutionRequest, runtime: Util.RuntimeOptions): ConfirmExpertSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.note)) {
    query['Note'] = request.note;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmExpertSolution',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmExpertSolution(request: ConfirmExpertSolutionRequest): ConfirmExpertSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmExpertSolutionWithOptions(request, runtime);
}

model CreateApplicantRequest {
  address?: string(name='Address'),
  applicantName?: string(name='ApplicantName'),
  applicantRegion?: int32(name='ApplicantRegion', example='1'),
  applicantType?: int32(name='ApplicantType', example='1'),
  authorizationOssKey?: string(name='AuthorizationOssKey', example='1219541161213057/attorney/gy378w6btam.jpg'),
  businessLicenceOssKey?: string(name='BusinessLicenceOssKey', example='1219541161213057/business_license/gmzl6cvbk48.png'),
  cardNumber?: string(name='CardNumber', example='123456'),
  contactAddress?: string(name='ContactAddress'),
  contactCity?: string(name='ContactCity'),
  contactCounty?: string(name='ContactCounty'),
  contactDistrict?: string(name='ContactDistrict'),
  contactEmail?: string(name='ContactEmail', example='test@alibaba.com'),
  contactName?: string(name='ContactName'),
  contactNumber?: string(name='ContactNumber', example='18611112222'),
  contactProvince?: string(name='ContactProvince'),
  contactZipcode?: string(name='ContactZipcode', example='100000'),
  country?: string(name='Country', example='2096'),
  EAddress?: string(name='EAddress', example='bei jing shi'),
  EName?: string(name='EName', example='zhang san'),
  idCardName?: string(name='IdCardName'),
  idCardNumber?: string(name='IdCardNumber'),
  idCardOssKey?: string(name='IdCardOssKey', example='1219541161213057/card/ujd8hthwfdk.png'),
  legalNoticeOssKey?: string(name='LegalNoticeOssKey', example='1219541161213057/legal_notice/mlnpsjmaed.jpg'),
  passportOssKey?: string(name='PassportOssKey', example='1219541161213057/pass_port/gmzl16cvbk48.png'),
  personalType?: long(name='PersonalType'),
  principalName?: int32(name='PrincipalName'),
  province?: string(name='Province'),
}

model CreateApplicantResponseBody = {
  applicantId?: string(name='ApplicantId', example='196689'),
  requestId?: string(name='RequestId', example='F9BB9AE5-E568-4F1F-B8EC-EB940B9930CB'),
}

model CreateApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApplicantResponseBody(name='body'),
}

async function createApplicantWithOptions(request: CreateApplicantRequest, runtime: Util.RuntimeOptions): CreateApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.applicantRegion)) {
    query['ApplicantRegion'] = request.applicantRegion;
  }
  if (!Util.isUnset(request.applicantType)) {
    query['ApplicantType'] = request.applicantType;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.businessLicenceOssKey)) {
    query['BusinessLicenceOssKey'] = request.businessLicenceOssKey;
  }
  if (!Util.isUnset(request.cardNumber)) {
    query['CardNumber'] = request.cardNumber;
  }
  if (!Util.isUnset(request.contactAddress)) {
    query['ContactAddress'] = request.contactAddress;
  }
  if (!Util.isUnset(request.contactCity)) {
    query['ContactCity'] = request.contactCity;
  }
  if (!Util.isUnset(request.contactCounty)) {
    query['ContactCounty'] = request.contactCounty;
  }
  if (!Util.isUnset(request.contactDistrict)) {
    query['ContactDistrict'] = request.contactDistrict;
  }
  if (!Util.isUnset(request.contactEmail)) {
    query['ContactEmail'] = request.contactEmail;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.contactNumber)) {
    query['ContactNumber'] = request.contactNumber;
  }
  if (!Util.isUnset(request.contactProvince)) {
    query['ContactProvince'] = request.contactProvince;
  }
  if (!Util.isUnset(request.contactZipcode)) {
    query['ContactZipcode'] = request.contactZipcode;
  }
  if (!Util.isUnset(request.country)) {
    query['Country'] = request.country;
  }
  if (!Util.isUnset(request.EAddress)) {
    query['EAddress'] = request.EAddress;
  }
  if (!Util.isUnset(request.EName)) {
    query['EName'] = request.EName;
  }
  if (!Util.isUnset(request.idCardName)) {
    query['IdCardName'] = request.idCardName;
  }
  if (!Util.isUnset(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!Util.isUnset(request.idCardOssKey)) {
    query['IdCardOssKey'] = request.idCardOssKey;
  }
  if (!Util.isUnset(request.legalNoticeOssKey)) {
    query['LegalNoticeOssKey'] = request.legalNoticeOssKey;
  }
  if (!Util.isUnset(request.passportOssKey)) {
    query['PassportOssKey'] = request.passportOssKey;
  }
  if (!Util.isUnset(request.personalType)) {
    query['PersonalType'] = request.personalType;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.province)) {
    query['Province'] = request.province;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApplicant(request: CreateApplicantRequest): CreateApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApplicantWithOptions(request, runtime);
}

model CreateCommodityOrderRequest {
  autoPay?: boolean(name='AutoPay'),
  bizType?: string(name='BizType'),
  chargeType?: string(name='ChargeType'),
  clientToken?: string(name='ClientToken'),
  commodityCode?: string(name='CommodityCode'),
  components?: map[string]any(name='Components'),
  duration?: int32(name='Duration'),
  instanceId?: string(name='InstanceId'),
  orderParams?: map[string]any(name='OrderParams'),
  orderType?: string(name='OrderType'),
  pricingCycle?: string(name='PricingCycle'),
  quantity?: int32(name='Quantity'),
  specCode?: string(name='SpecCode'),
  userId?: string(name='UserId'),
}

model CreateCommodityOrderShrinkRequest {
  autoPay?: boolean(name='AutoPay'),
  bizType?: string(name='BizType'),
  chargeType?: string(name='ChargeType'),
  clientToken?: string(name='ClientToken'),
  commodityCode?: string(name='CommodityCode'),
  componentsShrink?: string(name='Components'),
  duration?: int32(name='Duration'),
  instanceId?: string(name='InstanceId'),
  orderParamsShrink?: string(name='OrderParams'),
  orderType?: string(name='OrderType'),
  pricingCycle?: string(name='PricingCycle'),
  quantity?: int32(name='Quantity'),
  specCode?: string(name='SpecCode'),
  userId?: string(name='UserId'),
}

model CreateCommodityOrderResponseBody = {
  data?: [ long ](name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateCommodityOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCommodityOrderResponseBody(name='body'),
}

async function createCommodityOrderWithOptions(tmpReq: CreateCommodityOrderRequest, runtime: Util.RuntimeOptions): CreateCommodityOrderResponse {
  Util.validateModel(tmpReq);
  var request = new CreateCommodityOrderShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.components)) {
    request.componentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.components, 'Components', 'json');
  }
  if (!Util.isUnset(tmpReq.orderParams)) {
    request.orderParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.orderParams, 'OrderParams', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!Util.isUnset(request.componentsShrink)) {
    query['Components'] = request.componentsShrink;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.orderParamsShrink)) {
    query['OrderParams'] = request.orderParamsShrink;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.quantity)) {
    query['Quantity'] = request.quantity;
  }
  if (!Util.isUnset(request.specCode)) {
    query['SpecCode'] = request.specCode;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCommodityOrder',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCommodityOrder(request: CreateCommodityOrderRequest): CreateCommodityOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCommodityOrderWithOptions(request, runtime);
}

model CreateOrderRequest {
  agreementId?: string(name='AgreementId'),
  applicantId?: string(name='ApplicantId'),
  applicationType?: int32(name='ApplicationType'),
  authorizationOssKey?: string(name='AuthorizationOssKey'),
  autoPay?: boolean(name='AutoPay'),
  blackAndWhiteIcon?: string(name='BlackAndWhiteIcon'),
  channel?: string(name='Channel'),
  classifications?: string(name='Classifications'),
  idempotentId?: string(name='IdempotentId'),
  legalNoticeKey?: string(name='LegalNoticeKey'),
  payType?: string(name='PayType'),
  paymentCallback?: string(name='PaymentCallback'),
  principalName?: int32(name='PrincipalName'),
  source?: string(name='Source'),
  trademarkComment?: string(name='TrademarkComment'),
  trademarkIcon?: string(name='TrademarkIcon'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNameType?: string(name='TrademarkNameType'),
}

model CreateOrderResponseBody = {
  message?: string(name='Message'),
  orderIds?: map[string]any(name='OrderIds'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateOrderResponseBody(name='body'),
}

async function createOrderWithOptions(request: CreateOrderRequest, runtime: Util.RuntimeOptions): CreateOrderResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agreementId)) {
    query['AgreementId'] = request.agreementId;
  }
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  if (!Util.isUnset(request.applicationType)) {
    query['ApplicationType'] = request.applicationType;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.blackAndWhiteIcon)) {
    query['BlackAndWhiteIcon'] = request.blackAndWhiteIcon;
  }
  if (!Util.isUnset(request.channel)) {
    query['Channel'] = request.channel;
  }
  if (!Util.isUnset(request.classifications)) {
    query['Classifications'] = request.classifications;
  }
  if (!Util.isUnset(request.idempotentId)) {
    query['IdempotentId'] = request.idempotentId;
  }
  if (!Util.isUnset(request.legalNoticeKey)) {
    query['LegalNoticeKey'] = request.legalNoticeKey;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.paymentCallback)) {
    query['PaymentCallback'] = request.paymentCallback;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.trademarkComment)) {
    query['TrademarkComment'] = request.trademarkComment;
  }
  if (!Util.isUnset(request.trademarkIcon)) {
    query['TrademarkIcon'] = request.trademarkIcon;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  if (!Util.isUnset(request.trademarkNameType)) {
    query['TrademarkNameType'] = request.trademarkNameType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateOrder',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createOrder(request: CreateOrderRequest): CreateOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOrderWithOptions(request, runtime);
}

model CreateTrademarkApplicationRequest {
  agreementId?: string(name='AgreementId'),
  applicantId?: string(name='ApplicantId', example='111'),
  applicationType?: int32(name='ApplicationType', example='1'),
  authorizationOssKey?: string(name='AuthorizationOssKey', example='1219541161213057/attorney/9cgvhk2yd1l.JPG'),
  autoPay?: boolean(name='AutoPay', example='true'),
  blackAndWhiteIcon?: string(name='BlackAndWhiteIcon', example='1219541161213057/icon/gii9s4oyg8.jpg'),
  channel?: string(name='Channel'),
  classifications?: string(name='Classifications', example='{"38":"380005,380024,380050,380040,38020148,380004,38010007,38020149,38020141,380053"}'),
  idempotentId?: string(name='IdempotentId'),
  legalNoticeKey?: string(name='LegalNoticeKey'),
  principalName?: int32(name='PrincipalName'),
  source?: string(name='Source'),
  trademarkComment?: string(name='TrademarkComment'),
  trademarkIcon?: string(name='TrademarkIcon', example='1219541161213057/icon/gii9s4oyg8.jpg'),
  trademarkName?: string(name='TrademarkName', example='pop-test'),
  trademarkNameType?: string(name='TrademarkNameType', example='1'),
}

model CreateTrademarkApplicationResponseBody = {
  message?: string(name='Message'),
  orderId?: long(name='OrderId', example='204426185080629'),
  requestId?: string(name='RequestId', example='C40C3191-420F-42CC-9EEB-44D17B5DEB67'),
  success?: boolean(name='Success', example='true'),
}

model CreateTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTrademarkApplicationResponseBody(name='body'),
}

async function createTrademarkApplicationWithOptions(request: CreateTrademarkApplicationRequest, runtime: Util.RuntimeOptions): CreateTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agreementId)) {
    query['AgreementId'] = request.agreementId;
  }
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  if (!Util.isUnset(request.applicationType)) {
    query['ApplicationType'] = request.applicationType;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.blackAndWhiteIcon)) {
    query['BlackAndWhiteIcon'] = request.blackAndWhiteIcon;
  }
  if (!Util.isUnset(request.channel)) {
    query['Channel'] = request.channel;
  }
  if (!Util.isUnset(request.classifications)) {
    query['Classifications'] = request.classifications;
  }
  if (!Util.isUnset(request.idempotentId)) {
    query['IdempotentId'] = request.idempotentId;
  }
  if (!Util.isUnset(request.legalNoticeKey)) {
    query['LegalNoticeKey'] = request.legalNoticeKey;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.trademarkComment)) {
    query['TrademarkComment'] = request.trademarkComment;
  }
  if (!Util.isUnset(request.trademarkIcon)) {
    query['TrademarkIcon'] = request.trademarkIcon;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  if (!Util.isUnset(request.trademarkNameType)) {
    query['TrademarkNameType'] = request.trademarkNameType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createTrademarkApplication(request: CreateTrademarkApplicationRequest): CreateTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTrademarkApplicationWithOptions(request, runtime);
}

model DeleteSearchConditionRequest {
  conditionId?: long(name='ConditionId'),
  sessionId?: string(name='SessionId'),
  umid?: string(name='Umid'),
}

model DeleteSearchConditionResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteSearchConditionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSearchConditionResponseBody(name='body'),
}

async function deleteSearchConditionWithOptions(request: DeleteSearchConditionRequest, runtime: Util.RuntimeOptions): DeleteSearchConditionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.conditionId)) {
    query['ConditionId'] = request.conditionId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSearchCondition',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSearchCondition(request: DeleteSearchConditionRequest): DeleteSearchConditionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSearchConditionWithOptions(request, runtime);
}

model DescribeAdminTrademarkApplicationRequest {
  bizId?: string(name='BizId'),
}

model DescribeAdminTrademarkApplicationResponseBody = {
  acceptUrl?: string(name='AcceptUrl'),
  applicant?: {
    address?: string(name='Address'),
    applicantName?: string(name='ApplicantName'),
    applicantRegion?: int32(name='ApplicantRegion'),
    applicantType?: int32(name='ApplicantType'),
    auditStatus?: int32(name='AuditStatus'),
    authorizationUrl?: string(name='AuthorizationUrl'),
    businessLicenceUrl?: string(name='BusinessLicenceUrl'),
    cardNumber?: string(name='CardNumber'),
    contactAddress?: string(name='ContactAddress'),
    contactEmail?: string(name='ContactEmail'),
    contactName?: string(name='ContactName'),
    contactNumber?: string(name='ContactNumber'),
    contactZipcode?: string(name='ContactZipcode'),
    country?: string(name='Country'),
    EAddress?: string(name='EAddress'),
    EName?: string(name='EName'),
    idCardUrl?: string(name='IdCardUrl'),
    legalNoticeUrl?: string(name='LegalNoticeUrl'),
    passportUrl?: string(name='PassportUrl'),
    principalName?: int32(name='PrincipalName'),
    province?: string(name='Province'),
  }(name='Applicant'),
  applicantId?: long(name='ApplicantId'),
  applicationStatus?: int32(name='ApplicationStatus'),
  applicationType?: int32(name='ApplicationType'),
  authorizationUrl?: string(name='AuthorizationUrl'),
  bizId?: string(name='BizId'),
  blackAndWhiteIconUrl?: string(name='BlackAndWhiteIconUrl'),
  createTime?: long(name='CreateTime'),
  extendInfo?: map[string]any(name='ExtendInfo'),
  firstClassification?: {
    classificationCode?: string(name='ClassificationCode'),
    classificationName?: string(name='ClassificationName'),
  }(name='FirstClassification'),
  judgeResultUrls?: [ string ](name='JudgeResultUrls'),
  note?: string(name='Note'),
  orderId?: string(name='OrderId'),
  orderPrice?: float(name='OrderPrice'),
  principalName?: int32(name='PrincipalName'),
  receiptUrls?: [ string ](name='ReceiptUrls'),
  recvUserLogistics?: string(name='RecvUserLogistics'),
  requestId?: string(name='RequestId'),
  sendSbjLogistics?: string(name='SendSbjLogistics'),
  sendUserLogistics?: string(name='SendUserLogistics'),
  servicePrice?: float(name='ServicePrice'),
  supplements?: [ 
    {
      acceptExpirationDate?: long(name='AcceptExpirationDate'),
      acceptTime?: long(name='AcceptTime'),
      applicationType?: int32(name='ApplicationType'),
      content?: string(name='Content'),
      officialFile?: string(name='OfficialFile'),
      operateTime?: long(name='OperateTime'),
      orderId?: string(name='OrderId'),
      sbjExpirationDate?: long(name='SbjExpirationDate'),
      sendTime?: long(name='SendTime'),
      serialNumber?: string(name='SerialNumber'),
      supplementId?: long(name='SupplementId'),
      supplementStatus?: int32(name='SupplementStatus'),
      trademarkNumber?: string(name='TrademarkNumber'),
      userFiles?: [ string ](name='UserFiles'),
    }
  ](name='Supplements'),
  thirdClassifications?: [ 
    {
      classificationCode?: string(name='ClassificationCode'),
      classificationName?: string(name='ClassificationName'),
    }
  ](name='ThirdClassifications'),
  totalPrice?: float(name='TotalPrice'),
  trademarkIcon?: string(name='TrademarkIcon'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNameType?: int32(name='TrademarkNameType'),
  trademarkNumber?: string(name='TrademarkNumber'),
  updateTime?: long(name='UpdateTime'),
  userId?: string(name='UserId'),
}

model DescribeAdminTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdminTrademarkApplicationResponseBody(name='body'),
}

async function describeAdminTrademarkApplicationWithOptions(request: DescribeAdminTrademarkApplicationRequest, runtime: Util.RuntimeOptions): DescribeAdminTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdminTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAdminTrademarkApplication(request: DescribeAdminTrademarkApplicationRequest): DescribeAdminTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdminTrademarkApplicationWithOptions(request, runtime);
}

model DescribeApplicantRequest {
  applicantId?: long(name='ApplicantId', example='234567'),
}

model DescribeApplicantResponseBody = {
  address?: string(name='Address'),
  applicantId?: long(name='ApplicantId', example='191248'),
  applicantName?: string(name='ApplicantName'),
  applicantRegion?: int32(name='ApplicantRegion', example='1'),
  applicantType?: int32(name='ApplicantType', example='1'),
  applicantVersion?: string(name='ApplicantVersion'),
  auditStatus?: int32(name='AuditStatus', example='2'),
  authorizationAuditStatus?: int32(name='AuthorizationAuditStatus', example='1'),
  authorizationUrl?: string(name='AuthorizationUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/attorney/gy378w6btam.jpg?Expires=1570697609&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=bG50RI3XsQDML2%2BmEODR%2BERDJvk%3D'),
  businessLicenceUrl?: string(name='BusinessLicenceUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/business_license/gmzl6cvbk48.png?Expires=1568634805&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=fwg73e9bVEN1y6S5%2B0eoFj%2F0Ic4%3D'),
  cardNumber?: string(name='CardNumber', example='123456'),
  contactAddress?: string(name='ContactAddress'),
  contactCity?: string(name='ContactCity'),
  contactCounty?: string(name='ContactCounty'),
  contactDistrict?: string(name='ContactDistrict'),
  contactEmail?: string(name='ContactEmail', example='abcd@alibaba-inc.com'),
  contactName?: string(name='ContactName'),
  contactNumber?: string(name='ContactNumber', example='18611112222'),
  contactProvince?: string(name='ContactProvince'),
  contactZipcode?: string(name='ContactZipcode', example='100000'),
  country?: string(name='Country', example='2096'),
  EAddress?: string(name='EAddress', example='bei jing shi'),
  EName?: string(name='EName', example='zhang san'),
  idCardName?: string(name='IdCardName'),
  idCardNumber?: string(name='IdCardNumber'),
  idCardUrl?: string(name='IdCardUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/card/ujd8hthwfdk.png?Expires=1568634805&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=Q%2FyEfWRJ4KPskGHKmWYYTmsxwmg%3D'),
  legalNoticeUrl?: string(name='LegalNoticeUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com//1219541161213057/legal_notice/mlnpsjmaed.jpg?Expires=1568634805&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=XZAadmnTa7iixE02uKCK2DaLryU%3D'),
  note?: string(name='Note'),
  passportUrl?: string(name='PassportUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/attorney/gy378w6btam.jpg?Expires=1568634805&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=RFN730Owt3a7XJ6W%2BBsAJNHqFeE%3D'),
  personalType?: long(name='PersonalType'),
  principalName?: int32(name='PrincipalName'),
  province?: string(name='Province'),
  requestId?: string(name='RequestId', example='95BB34D6-4A1D-4C55-876F-4B66044BD75B'),
  validDate?: long(name='ValidDate'),
}

model DescribeApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApplicantResponseBody(name='body'),
}

async function describeApplicantWithOptions(request: DescribeApplicantRequest, runtime: Util.RuntimeOptions): DescribeApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApplicant(request: DescribeApplicantRequest): DescribeApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApplicantWithOptions(request, runtime);
}

model DescribePartnerTrademarkApplicationRequest {
  bizId?: string(name='BizId'),
}

model DescribePartnerTrademarkApplicationResponseBody = {
  acceptUrl?: string(name='AcceptUrl'),
  applicant?: {
    address?: string(name='Address'),
    applicantName?: string(name='ApplicantName'),
    applicantRegion?: int32(name='ApplicantRegion'),
    applicantType?: int32(name='ApplicantType'),
    auditStatus?: int32(name='AuditStatus'),
    authorizationUrl?: string(name='AuthorizationUrl'),
    businessLicenceUrl?: string(name='BusinessLicenceUrl'),
    cardNumber?: string(name='CardNumber'),
    contactAddress?: string(name='ContactAddress'),
    contactEmail?: string(name='ContactEmail'),
    contactName?: string(name='ContactName'),
    contactNumber?: string(name='ContactNumber'),
    contactZipcode?: string(name='ContactZipcode'),
    country?: string(name='Country'),
    EAddress?: string(name='EAddress'),
    EName?: string(name='EName'),
    idCardUrl?: string(name='IdCardUrl'),
    legalNoticeUrl?: string(name='LegalNoticeUrl'),
    passportUrl?: string(name='PassportUrl'),
    principalName?: int32(name='PrincipalName'),
    province?: string(name='Province'),
  }(name='Applicant'),
  applicantId?: long(name='ApplicantId'),
  applicationStatus?: int32(name='ApplicationStatus'),
  applicationType?: int32(name='ApplicationType'),
  authorizationUrl?: string(name='AuthorizationUrl'),
  bizId?: string(name='BizId'),
  blackAndWhiteIconUrl?: string(name='BlackAndWhiteIconUrl'),
  createTime?: long(name='CreateTime'),
  extendInfo?: map[string]any(name='ExtendInfo'),
  firstClassification?: {
    classificationCode?: string(name='ClassificationCode'),
    classificationName?: string(name='ClassificationName'),
  }(name='FirstClassification'),
  judgeResultUrls?: [ string ](name='JudgeResultUrls'),
  note?: string(name='Note'),
  orderId?: string(name='OrderId'),
  orderPrice?: float(name='OrderPrice'),
  principalName?: int32(name='PrincipalName'),
  receiptUrls?: [ string ](name='ReceiptUrls'),
  recvUserLogistics?: string(name='RecvUserLogistics'),
  requestId?: string(name='RequestId'),
  sendSbjLogistics?: string(name='SendSbjLogistics'),
  sendUserLogistics?: string(name='SendUserLogistics'),
  servicePrice?: float(name='ServicePrice'),
  supplements?: [ 
    {
      acceptExpirationDate?: long(name='AcceptExpirationDate'),
      acceptTime?: long(name='AcceptTime'),
      applicationType?: int32(name='ApplicationType'),
      content?: string(name='Content'),
      officialFile?: string(name='OfficialFile'),
      operateTime?: long(name='OperateTime'),
      orderId?: string(name='OrderId'),
      sbjExpirationDate?: long(name='SbjExpirationDate'),
      sendTime?: long(name='SendTime'),
      serialNumber?: string(name='SerialNumber'),
      supplementId?: long(name='SupplementId'),
      supplementStatus?: int32(name='SupplementStatus'),
      trademarkNumber?: string(name='TrademarkNumber'),
      userFiles?: [ string ](name='UserFiles'),
    }
  ](name='Supplements'),
  thirdClassifications?: [ 
    {
      classificationCode?: string(name='ClassificationCode'),
      classificationName?: string(name='ClassificationName'),
    }
  ](name='ThirdClassifications'),
  totalPrice?: float(name='TotalPrice'),
  trademarkIcon?: string(name='TrademarkIcon'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNameType?: int32(name='TrademarkNameType'),
  trademarkNumber?: string(name='TrademarkNumber'),
  updateTime?: long(name='UpdateTime'),
}

model DescribePartnerTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePartnerTrademarkApplicationResponseBody(name='body'),
}

async function describePartnerTrademarkApplicationWithOptions(request: DescribePartnerTrademarkApplicationRequest, runtime: Util.RuntimeOptions): DescribePartnerTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePartnerTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePartnerTrademarkApplication(request: DescribePartnerTrademarkApplicationRequest): DescribePartnerTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePartnerTrademarkApplicationWithOptions(request, runtime);
}

model DescribeQualificationStatusRequest {
  tbUid?: string(name='TbUid'),
}

model DescribeQualificationStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  success?: boolean(name='Success'),
}

model DescribeQualificationStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeQualificationStatusResponseBody(name='body'),
}

async function describeQualificationStatusWithOptions(request: DescribeQualificationStatusRequest, runtime: Util.RuntimeOptions): DescribeQualificationStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.tbUid)) {
    query['TbUid'] = request.tbUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeQualificationStatus',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeQualificationStatus(request: DescribeQualificationStatusRequest): DescribeQualificationStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeQualificationStatusWithOptions(request, runtime);
}

model DescribeSupplementRequest {
  supplementId?: long(name='SupplementId', example='1'),
}

model DescribeSupplementResponseBody = {
  acceptExpirationDate?: long(name='AcceptExpirationDate', example='1569168000000'),
  acceptTime?: long(name='AcceptTime', example='1568736000000'),
  applicationType?: int32(name='ApplicationType', example='1'),
  content?: string(name='Content'),
  officialFile?: string(name='OfficialFile', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/supplement/27102013/4a36c25c.pdf?Expires=1568721724&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=sOaVgAigLlFruOcYDdusZGl5hwk%3D'),
  operateTime?: long(name='OperateTime', example='1568684449000'),
  requestId?: string(name='RequestId', example='9A51DFA3-E149-48C1-842A-7CAEF0CF31BB'),
  sbjExpirationDate?: long(name='SbjExpirationDate', example='1569772800000'),
  sendTime?: long(name='SendTime', example='1568649600000'),
  serialNumber?: string(name='SerialNumber', example='B1021TMZC00000040188506ZCSL0100016'),
  supplementId?: long(name='SupplementId', example='5088'),
  supplementStatus?: int32(name='SupplementStatus', example='1'),
  trademarkNumber?: string(name='TrademarkNumber', example='123456765'),
  userFiles?: {
    userFile?: [ string ](name='UserFile')
  }(name='UserFiles'),
}

model DescribeSupplementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSupplementResponseBody(name='body'),
}

/**
  * ****
  *
  * @param request DescribeSupplementRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return DescribeSupplementResponse
 */
async function describeSupplementWithOptions(request: DescribeSupplementRequest, runtime: Util.RuntimeOptions): DescribeSupplementResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.supplementId)) {
    query['SupplementId'] = request.supplementId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSupplement',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ****
  *
  * @param request DescribeSupplementRequest
  * @return DescribeSupplementResponse
 */
async function describeSupplement(request: DescribeSupplementRequest): DescribeSupplementResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSupplementWithOptions(request, runtime);
}

model DescribeTrademarkApplicationRequest {
  bizId?: string(name='BizId', example='trademark_register-cn-123456789'),
}

model DescribeTrademarkApplicationResponseBody = {
  acceptUrl?: string(name='AcceptUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/sbj-notice/register-notice-123456789SHANG_BIAO_ZHU_CE_SHEN_QING_SHOU_LI_TONG_ZHI_SHU1560887850185.pdf?Expires=1568629374&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=TnkOWf7JrSacldGW1p3uu5YDt2Y%3D'),
  agreementId?: string(name='AgreementId'),
  applicant?: {
    address?: string(name='Address'),
    applicantName?: string(name='ApplicantName'),
    applicantRegion?: int32(name='ApplicantRegion', example='1'),
    applicantType?: int32(name='ApplicantType', example='1'),
    auditStatus?: int32(name='AuditStatus', example='1'),
    authorizationUrl?: string(name='AuthorizationUrl'),
    businessLicenceUrl?: string(name='BusinessLicenceUrl'),
    cardNumber?: string(name='CardNumber', example='123456'),
    contactAddress?: string(name='ContactAddress'),
    contactEmail?: string(name='ContactEmail', example='test@alibaba.com'),
    contactName?: string(name='ContactName'),
    contactNumber?: string(name='ContactNumber', example='23456789'),
    contactZipcode?: string(name='ContactZipcode', example='100000'),
    country?: string(name='Country', example='2046'),
    EAddress?: string(name='EAddress', example='bei jing shi'),
    EName?: string(name='EName', example='zhang san'),
    idCardName?: string(name='IdCardName'),
    idCardNumber?: string(name='IdCardNumber'),
    idCardUrl?: string(name='IdCardUrl', example='http://.....'),
    legalNoticeUrl?: string(name='LegalNoticeUrl', example='http://.....'),
    passportUrl?: string(name='PassportUrl', example='http://.....'),
    personalType?: long(name='PersonalType'),
    principalName?: int32(name='PrincipalName'),
    province?: string(name='Province'),
  }(name='Applicant'),
  applicantId?: long(name='ApplicantId', example='23456'),
  applicationStatus?: int32(name='ApplicationStatus', example='1'),
  applicationType?: int32(name='ApplicationType', example='1'),
  authorizationUrl?: string(name='AuthorizationUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/usertrademark/191248_E1DD11C3DC8D82CBA3E08F438C3415BA.jpg?Expires=1568629293&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=bXZ6VzFAqVyBrI8mxo1XYN6BOsQ%3D'),
  bizId?: string(name='BizId', example='trademark_register-cn-123456789'),
  blackAndWhiteIconUrl?: string(name='BlackAndWhiteIconUrl', example='http://...'),
  createTime?: long(name='CreateTime', example='1568626966203'),
  extendInfo?: map[string]any(name='ExtendInfo', example='{}'),
  firstClassification?: {
    classificationCode?: string(name='ClassificationCode', example='03'),
    classificationName?: string(name='ClassificationName'),
  }(name='FirstClassification'),
  flags?: {
    flag?: [ int32 ](name='Flag')
  }(name='Flags'),
  judgeResultUrls?: {
    judgeResultUrl?: [ string ](name='JudgeResultUrl')
  }(name='JudgeResultUrls'),
  note?: string(name='Note'),
  orderId?: string(name='OrderId', example='204469008550629'),
  orderPrice?: float(name='OrderPrice', example='368.0'),
  principalName?: int32(name='PrincipalName'),
  receiptUrls?: {
    receiptUrl?: [ string ](name='ReceiptUrl')
  }(name='ReceiptUrls'),
  recvUserLogistics?: string(name='RecvUserLogistics', example='3456789'),
  requestId?: string(name='RequestId', example='1F34C10A-E135-4782-9EAB-9622F939CAD7'),
  sendSbjLogistics?: string(name='SendSbjLogistics', example='23456789'),
  sendUserLogistics?: string(name='SendUserLogistics', example='34567890'),
  servicePrice?: float(name='ServicePrice', example='100.0'),
  supplements?: {
    supplement?: [ 
    {
      acceptExpirationDate?: long(name='AcceptExpirationDate', example='1568276757000'),
      acceptTime?: long(name='AcceptTime', example='1568276757000'),
      applicationType?: int32(name='ApplicationType', example='1'),
      content?: string(name='Content'),
      officialFile?: string(name='OfficialFile', example='http://...'),
      operateTime?: long(name='OperateTime', example='1568276757000'),
      orderId?: string(name='OrderId', example='4567890'),
      sbjExpirationDate?: long(name='SbjExpirationDate', example='1568276757000'),
      sendTime?: long(name='SendTime', example='1568276757000'),
      serialNumber?: string(name='SerialNumber', example='M34567890'),
      supplementId?: long(name='SupplementId', example='345678'),
      supplementStatus?: int32(name='SupplementStatus', example='1'),
      trademarkNumber?: string(name='TrademarkNumber', example='3456789'),
      userFiles?: {
        userFile?: [ string ](name='UserFile')
      }(name='UserFiles'),
    }
  ](name='Supplement')
  }(name='Supplements'),
  thirdClassifications?: {
    thirdClassification?: [ 
    {
      classificationCode?: string(name='ClassificationCode', example='03'),
      classificationName?: string(name='ClassificationName'),
    }
  ](name='ThirdClassification')
  }(name='ThirdClassifications'),
  totalPrice?: float(name='TotalPrice', example='0.0'),
  trademarkIcon?: string(name='TrademarkIcon', example='http://...'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNameType?: int32(name='TrademarkNameType', example='1'),
  trademarkNumber?: string(name='TrademarkNumber', example='23456789'),
  updateTime?: long(name='UpdateTime', example='1568276757000'),
}

model DescribeTrademarkApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTrademarkApplicationResponseBody(name='body'),
}

async function describeTrademarkApplicationWithOptions(request: DescribeTrademarkApplicationRequest, runtime: Util.RuntimeOptions): DescribeTrademarkApplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTrademarkApplication',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTrademarkApplication(request: DescribeTrademarkApplicationRequest): DescribeTrademarkApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTrademarkApplicationWithOptions(request, runtime);
}

model DescribeTrademarkDetailForInnerRequest {
  uid?: string(name='Uid'),
  umid?: string(name='Umid'),
}

model DescribeTrademarkDetailForInnerResponseBody = {
  agency?: string(name='Agency'),
  applyDate?: string(name='ApplyDate'),
  classification?: string(name='Classification'),
  exclusiveDateLimit?: string(name='ExclusiveDateLimit'),
  flowList?: [ 
    {
      date?: string(name='Date'),
      procedureCode?: string(name='ProcedureCode'),
      procedureDate?: string(name='ProcedureDate'),
      procedureName?: string(name='ProcedureName'),
      procedureResult?: string(name='ProcedureResult'),
      procedureStep?: string(name='ProcedureStep'),
      registrationNumber?: string(name='RegistrationNumber'),
    }
  ](name='FlowList'),
  image?: string(name='Image'),
  imageElement?: string(name='ImageElement'),
  intlRegDate?: string(name='IntlRegDate'),
  lastProcedureStatus?: string(name='LastProcedureStatus'),
  name?: string(name='Name'),
  noticeList?: [ 
    {
      annDate?: string(name='AnnDate'),
      annId?: string(name='AnnId'),
      annNum?: string(name='AnnNum'),
      annTypeCode?: string(name='AnnTypeCode'),
      annTypeName?: string(name='AnnTypeName'),
      applicant?: string(name='Applicant'),
      date?: string(name='Date'),
      imageUrl?: string(name='ImageUrl'),
      originalImageUrl?: string(name='OriginalImageUrl'),
      pageNo?: string(name='PageNo'),
      reactNum?: string(name='ReactNum'),
      registrationNumber?: string(name='RegistrationNumber'),
      trademarkName?: string(name='TrademarkName'),
    }
  ](name='NoticeList'),
  ownerAddress?: string(name='OwnerAddress'),
  ownerEnAddress?: string(name='OwnerEnAddress'),
  ownerEnName?: string(name='OwnerEnName'),
  ownerName?: string(name='OwnerName'),
  preAnnDate?: string(name='PreAnnDate'),
  preAnnNum?: string(name='PreAnnNum'),
  priorityDate?: string(name='PriorityDate'),
  product?: string(name='Product'),
  productDescription?: string(name='ProductDescription'),
  regAnnDate?: string(name='RegAnnDate'),
  regAnnNum?: int32(name='RegAnnNum'),
  registrationNumber?: string(name='RegistrationNumber'),
  registrationType?: string(name='RegistrationType'),
  requestId?: string(name='RequestId'),
  share?: string(name='Share'),
  similarGroup?: string(name='SimilarGroup'),
  status?: string(name='Status'),
  subsequentDesignationDate?: string(name='SubsequentDesignationDate'),
  uid?: string(name='Uid'),
}

model DescribeTrademarkDetailForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTrademarkDetailForInnerResponseBody(name='body'),
}

async function describeTrademarkDetailForInnerWithOptions(request: DescribeTrademarkDetailForInnerRequest, runtime: Util.RuntimeOptions): DescribeTrademarkDetailForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTrademarkDetailForInner',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTrademarkDetailForInner(request: DescribeTrademarkDetailForInnerRequest): DescribeTrademarkDetailForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTrademarkDetailForInnerWithOptions(request, runtime);
}

model GenerateUploadFilePolicyRequest {
  fileType?: string(name='FileType', example='ATTORNEY'),
}

model GenerateUploadFilePolicyResponseBody = {
  accessId?: string(name='AccessId', description='OSSAccessKeyId', example='hObpgEXoca42qH3V'),
  encodedPolicy?: string(name='EncodedPolicy', example='eyJleHBpcmF0aW9uIjoiMjAxOS0wOS0xNlQwODo1Njo0Ni4yMjFaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMjA0ODAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsIjEzNDg2NTM3NTU0NzI4NTUvaWNvbiJdLFsiZXEiLCIkYnVja2V0IiwidHJhZGUtbWFyay11c2VyLXVwbG9hZCJdXX0='),
  expireTime?: long(name='ExpireTime', example='1568624206221'),
  fileDir?: string(name='FileDir', example='123456789/icon'),
  host?: string(name='Host', description='host', example='//trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/'),
  requestId?: string(name='RequestId', example='7E617C0D-C226-473D-A9C4-3252B7792FA1'),
  signature?: string(name='Signature', example='yjIcnOapBfLe4kt0nIF272GprgE='),
}

model GenerateUploadFilePolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateUploadFilePolicyResponseBody(name='body'),
}

async function generateUploadFilePolicyWithOptions(request: GenerateUploadFilePolicyRequest, runtime: Util.RuntimeOptions): GenerateUploadFilePolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileType)) {
    query['FileType'] = request.fileType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateUploadFilePolicy',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function generateUploadFilePolicy(request: GenerateUploadFilePolicyRequest): GenerateUploadFilePolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateUploadFilePolicyWithOptions(request, runtime);
}

model GetAlipayUrlRequest {
  bizType?: string(name='BizType'),
  orderId?: long(name='OrderId'),
  returnUrl?: string(name='ReturnUrl'),
  type?: string(name='Type'),
}

model GetAlipayUrlResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetAlipayUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAlipayUrlResponseBody(name='body'),
}

async function getAlipayUrlWithOptions(request: GetAlipayUrlRequest, runtime: Util.RuntimeOptions): GetAlipayUrlResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAlipayUrl',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAlipayUrl(request: GetAlipayUrlRequest): GetAlipayUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAlipayUrlWithOptions(request, runtime);
}

model GetOrderConfirmUrlRequest {
  items?: [ 
    {
      itemCode?: string(name='ItemCode'),
      quantity?: long(name='Quantity'),
    }
  ](name='Items'),
  outTraceCode?: string(name='OutTraceCode'),
  outTraceType?: string(name='OutTraceType'),
}

model GetOrderConfirmUrlResponseBody = {
  confirmUrl?: string(name='ConfirmUrl'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetOrderConfirmUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOrderConfirmUrlResponseBody(name='body'),
}

async function getOrderConfirmUrlWithOptions(request: GetOrderConfirmUrlRequest, runtime: Util.RuntimeOptions): GetOrderConfirmUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.items)) {
    query['Items'] = request.items;
  }
  if (!Util.isUnset(request.outTraceCode)) {
    query['OutTraceCode'] = request.outTraceCode;
  }
  if (!Util.isUnset(request.outTraceType)) {
    query['OutTraceType'] = request.outTraceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOrderConfirmUrl',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOrderConfirmUrl(request: GetOrderConfirmUrlRequest): GetOrderConfirmUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOrderConfirmUrlWithOptions(request, runtime);
}

model GetStsByTaobaoUidRequest {
  aliyunUid?: string(name='AliyunUid'),
  tbUid?: string(name='TbUid'),
}

model GetStsByTaobaoUidResponseBody = {
  accessKeyId?: string(name='AccessKeyId'),
  accessKeySecret?: string(name='AccessKeySecret'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  expiration?: string(name='Expiration'),
  requestId?: string(name='RequestId'),
  securityToken?: string(name='SecurityToken'),
  success?: boolean(name='Success'),
}

model GetStsByTaobaoUidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetStsByTaobaoUidResponseBody(name='body'),
}

async function getStsByTaobaoUidWithOptions(request: GetStsByTaobaoUidRequest, runtime: Util.RuntimeOptions): GetStsByTaobaoUidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunUid)) {
    query['AliyunUid'] = request.aliyunUid;
  }
  if (!Util.isUnset(request.tbUid)) {
    query['TbUid'] = request.tbUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetStsByTaobaoUid',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStsByTaobaoUid(request: GetStsByTaobaoUidRequest): GetStsByTaobaoUidResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStsByTaobaoUidWithOptions(request, runtime);
}

model ListAdminTrademarkApplicationLogsRequest {
  bizId?: string(name='BizId'),
}

model ListAdminTrademarkApplicationLogsResponseBody = {
  requestId?: string(name='RequestId'),
  trademarkApplicationLogs?: [ 
    {
      bizId?: string(name='BizId'),
      bizStatus?: int32(name='BizStatus'),
      note?: string(name='Note'),
      operateTime?: long(name='OperateTime'),
      operateType?: int32(name='OperateType'),
    }
  ](name='TrademarkApplicationLogs'),
}

model ListAdminTrademarkApplicationLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAdminTrademarkApplicationLogsResponseBody(name='body'),
}

async function listAdminTrademarkApplicationLogsWithOptions(request: ListAdminTrademarkApplicationLogsRequest, runtime: Util.RuntimeOptions): ListAdminTrademarkApplicationLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAdminTrademarkApplicationLogs',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAdminTrademarkApplicationLogs(request: ListAdminTrademarkApplicationLogsRequest): ListAdminTrademarkApplicationLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAdminTrademarkApplicationLogsWithOptions(request, runtime);
}

model ListAdminTrademarkApplicationsRequest {
  applicantName?: string(name='ApplicantName'),
  applicationStatus?: int32(name='ApplicationStatus'),
  applicationType?: string(name='ApplicationType'),
  bizId?: string(name='BizId'),
  orderId?: string(name='OrderId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  sortOrder?: string(name='SortOrder'),
  supplementStatus?: int32(name='SupplementStatus'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNumber?: string(name='TrademarkNumber'),
  userId?: string(name='UserId'),
}

model ListAdminTrademarkApplicationsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  trademarkApplications?: [ 
    {
      applicantId?: long(name='ApplicantId'),
      applicantName?: string(name='ApplicantName'),
      applicationStatus?: int32(name='ApplicationStatus'),
      applicationType?: int32(name='ApplicationType'),
      authorizationUrl?: string(name='AuthorizationUrl'),
      bizId?: string(name='BizId'),
      createTime?: long(name='CreateTime'),
      firstClassification?: {
        classificationCode?: string(name='ClassificationCode'),
        classificationName?: string(name='ClassificationName'),
      }(name='FirstClassification'),
      flags?: [ string ](name='Flags'),
      note?: string(name='Note'),
      orderId?: string(name='OrderId'),
      orderPrice?: float(name='OrderPrice'),
      principalName?: int32(name='PrincipalName'),
      servicePrice?: float(name='ServicePrice'),
      supplementId?: long(name='SupplementId'),
      supplementStatus?: int32(name='SupplementStatus'),
      systemVersion?: string(name='SystemVersion'),
      thirdClassification?: [ 
        {
          classificationCode?: string(name='ClassificationCode'),
          classificationName?: string(name='ClassificationName'),
        }
      ](name='ThirdClassification'),
      totalPrice?: float(name='TotalPrice'),
      trademarkIcon?: string(name='TrademarkIcon'),
      trademarkName?: string(name='TrademarkName'),
      trademarkNumber?: string(name='TrademarkNumber'),
      updateTime?: long(name='UpdateTime'),
      userId?: string(name='UserId'),
    }
  ](name='TrademarkApplications'),
}

model ListAdminTrademarkApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAdminTrademarkApplicationsResponseBody(name='body'),
}

async function listAdminTrademarkApplicationsWithOptions(request: ListAdminTrademarkApplicationsRequest, runtime: Util.RuntimeOptions): ListAdminTrademarkApplicationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.applicationStatus)) {
    query['ApplicationStatus'] = request.applicationStatus;
  }
  if (!Util.isUnset(request.applicationType)) {
    query['ApplicationType'] = request.applicationType;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.supplementStatus)) {
    query['SupplementStatus'] = request.supplementStatus;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  if (!Util.isUnset(request.trademarkNumber)) {
    query['TrademarkNumber'] = request.trademarkNumber;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAdminTrademarkApplications',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAdminTrademarkApplications(request: ListAdminTrademarkApplicationsRequest): ListAdminTrademarkApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAdminTrademarkApplicationsWithOptions(request, runtime);
}

model ListApplicantsRequest {
  applicantName?: string(name='ApplicantName'),
  applicantRegion?: int32(name='ApplicantRegion', example='1'),
  applicantType?: int32(name='ApplicantType', example='1'),
  applicantVersion?: string(name='ApplicantVersion'),
  auditStatus?: int32(name='AuditStatus', example='1'),
  cardNumber?: string(name='CardNumber', example='23456789'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  principalName?: int32(name='PrincipalName'),
  systemVersion?: string(name='SystemVersion', example='V1'),
}

model ListApplicantsResponseBody = {
  applicants?: {
    applicant?: [ 
    {
      applicantId?: long(name='ApplicantId', example='66295'),
      applicantName?: string(name='ApplicantName'),
      applicantRegion?: int32(name='ApplicantRegion', example='1'),
      applicantType?: int32(name='ApplicantType', example='1'),
      applicantVersion?: string(name='ApplicantVersion'),
      auditStatus?: int32(name='AuditStatus', example='4'),
      authorizationAuditStatus?: int32(name='AuthorizationAuditStatus', example='1'),
      authorizationUrl?: string(name='AuthorizationUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/attorney/n9neyrbkkp.png?Expires=1570698256&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=i9IdRS8N1swKF%2FJyMpkHglFgFuw%3D'),
      cardNumber?: string(name='CardNumber', example='31231231'),
      contactName?: string(name='ContactName', example='23432qwe'),
      principalName?: int32(name='PrincipalName'),
      systemVersion?: string(name='SystemVersion'),
      validDate?: long(name='ValidDate'),
    }
  ](name='Applicant')
  }(name='Applicants'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='8B08302F-8306-4A6F-BFAF-E9EC69A26476'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListApplicantsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListApplicantsResponseBody(name='body'),
}

async function listApplicantsWithOptions(request: ListApplicantsRequest, runtime: Util.RuntimeOptions): ListApplicantsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.applicantRegion)) {
    query['ApplicantRegion'] = request.applicantRegion;
  }
  if (!Util.isUnset(request.applicantType)) {
    query['ApplicantType'] = request.applicantType;
  }
  if (!Util.isUnset(request.applicantVersion)) {
    query['ApplicantVersion'] = request.applicantVersion;
  }
  if (!Util.isUnset(request.auditStatus)) {
    query['AuditStatus'] = request.auditStatus;
  }
  if (!Util.isUnset(request.cardNumber)) {
    query['CardNumber'] = request.cardNumber;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.systemVersion)) {
    query['SystemVersion'] = request.systemVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApplicants',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listApplicants(request: ListApplicantsRequest): ListApplicantsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listApplicantsWithOptions(request, runtime);
}

model ListAreasRequest {
  bizType?: string(name='BizType'),
  parentCode?: string(name='ParentCode'),
}

model ListAreasResponseBody = {
  datas?: [ 
    {
      code?: string(name='Code'),
      name?: string(name='Name'),
      parentCode?: string(name='ParentCode'),
      sortNum?: int32(name='SortNum'),
      subArea?: [ 
        {
          code?: string(name='Code'),
          name?: string(name='Name'),
          parentCode?: string(name='ParentCode'),
          sortNum?: int32(name='SortNum'),
        }
      ](name='SubArea'),
    }
  ](name='Datas'),
  requestId?: string(name='RequestId'),
}

model ListAreasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAreasResponseBody(name='body'),
}

async function listAreasWithOptions(request: ListAreasRequest, runtime: Util.RuntimeOptions): ListAreasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.parentCode)) {
    query['ParentCode'] = request.parentCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAreas',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAreas(request: ListAreasRequest): ListAreasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAreasWithOptions(request, runtime);
}

model ListClassificationConditionsRequest {
  tagName?: string(name='TagName'),
  type?: long(name='Type'),
}

model ListClassificationConditionsResponseBody = {
  data?: [ 
    {
      conditionContent?: string(name='ConditionContent'),
      createTime?: long(name='CreateTime'),
      id?: long(name='Id'),
      sessionId?: string(name='SessionId'),
      tagName?: string(name='TagName'),
      type?: long(name='Type'),
      umid?: string(name='Umid'),
      updateTime?: long(name='UpdateTime'),
      userId?: long(name='UserId'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId'),
}

model ListClassificationConditionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListClassificationConditionsResponseBody(name='body'),
}

async function listClassificationConditionsWithOptions(request: ListClassificationConditionsRequest, runtime: Util.RuntimeOptions): ListClassificationConditionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClassificationConditions',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listClassificationConditions(request: ListClassificationConditionsRequest): ListClassificationConditionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listClassificationConditionsWithOptions(request, runtime);
}

model ListClassificationsRequest {
  parentCode?: string(name='ParentCode', example='01'),
}

model ListClassificationsResponseBody = {
  classifications?: {
    classification?: [ 
    {
      classificationCode?: string(name='ClassificationCode', example='01'),
      classificationName?: string(name='ClassificationName'),
      id?: long(name='Id'),
      level?: int32(name='Level', example='1'),
      officialCode?: string(name='OfficialCode', example='01'),
      parentCode?: string(name='ParentCode', example='0'),
    }
  ](name='Classification')
  }(name='Classifications'),
  requestId?: string(name='RequestId', example='B1D37915-0B88-4287-B5F4-4DC20D375CF9'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListClassificationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListClassificationsResponseBody(name='body'),
}

async function listClassificationsWithOptions(request: ListClassificationsRequest, runtime: Util.RuntimeOptions): ListClassificationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.parentCode)) {
    query['ParentCode'] = request.parentCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClassifications',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listClassifications(request: ListClassificationsRequest): ListClassificationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listClassificationsWithOptions(request, runtime);
}

model ListTrademarkApplicationLogsRequest {
  bizId?: string(name='BizId', example='trademark_register-cn-123456789'),
}

model ListTrademarkApplicationLogsResponseBody = {
  requestId?: string(name='RequestId', example='5D77ECD7-38AE-4D46-AA38-95EE8552CE96'),
  trademarkApplicationLogs?: {
    trademarkApplicationLog?: [ 
    {
      bizId?: string(name='BizId', example='trademark_register-cn-78v1a67zy01'),
      bizStatus?: int32(name='BizStatus', example='0'),
      note?: string(name='Note'),
      operateTime?: long(name='OperateTime', example='1568632960000'),
      operateType?: int32(name='OperateType', example='1'),
    }
  ](name='TrademarkApplicationLog')
  }(name='TrademarkApplicationLogs'),
}

model ListTrademarkApplicationLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrademarkApplicationLogsResponseBody(name='body'),
}

async function listTrademarkApplicationLogsWithOptions(request: ListTrademarkApplicationLogsRequest, runtime: Util.RuntimeOptions): ListTrademarkApplicationLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTrademarkApplicationLogs',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTrademarkApplicationLogs(request: ListTrademarkApplicationLogsRequest): ListTrademarkApplicationLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTrademarkApplicationLogsWithOptions(request, runtime);
}

model ListTrademarkApplicationsRequest {
  applicantName?: string(name='ApplicantName'),
  applicationStatus?: int32(name='ApplicationStatus', example='0'),
  applicationType?: string(name='ApplicationType', example='1'),
  bizId?: string(name='BizId', example='trademark_prepayment_pre-cn-12345678'),
  createTimeLeft?: long(name='CreateTimeLeft'),
  createTimeRight?: long(name='CreateTimeRight'),
  flag?: int32(name='Flag'),
  orderId?: string(name='OrderId', example='204469008550629'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  productType?: int32(name='ProductType'),
  queryVoucherOrderDoneFlag?: boolean(name='QueryVoucherOrderDoneFlag'),
  queryVoucherOrderFlag?: boolean(name='QueryVoucherOrderFlag'),
  sortFiled?: string(name='SortFiled'),
  sortOrder?: string(name='SortOrder', example='ASC'),
  supplementStatus?: int32(name='SupplementStatus', example='2'),
  trademarkName?: string(name='TrademarkName'),
  trademarkNumber?: string(name='TrademarkNumber', example='12345678'),
}

model ListTrademarkApplicationsResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='023DD338-800F-4C55-86E6-EE8E203336BF'),
  totalCount?: int32(name='TotalCount', example='1'),
  trademarkApplications?: {
    trademarkApplication?: [ 
    {
      agreementId?: string(name='AgreementId'),
      applicantId?: long(name='ApplicantId', example='1'),
      applicantName?: string(name='ApplicantName'),
      applicationStatus?: int32(name='ApplicationStatus', example='1'),
      applicationType?: int32(name='ApplicationType', example='1'),
      authorizationUrl?: string(name='AuthorizationUrl', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/icon/6xreg1ooy9a.jpg?Expires=1570955079&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=Qdyo6vrdAaktFB6iEumnXO2plME%3D'),
      bizId?: string(name='BizId', example='trademark_register-cn-v0h1awaycdp'),
      createTime?: long(name='CreateTime', example='1568276757000'),
      firstClassification?: {
        classificationCode?: string(name='ClassificationCode', example='03'),
        classificationName?: string(name='ClassificationName'),
      }(name='FirstClassification'),
      flags?: {
        flags?: [ string ](name='Flags')
      }(name='Flags'),
      note?: string(name='Note'),
      orderId?: string(name='OrderId', example='204469008550629'),
      orderPrice?: float(name='OrderPrice', example='368.0'),
      principalName?: int32(name='PrincipalName'),
      servicePrice?: float(name='ServicePrice', example='0.0'),
      supplementId?: long(name='SupplementId', example='1'),
      supplementStatus?: int32(name='SupplementStatus', example='1'),
      systemVersion?: string(name='SystemVersion'),
      thirdClassification?: {
        thirdClassification?: [ 
        {
          classificationCode?: string(name='ClassificationCode', example='030026'),
          classificationName?: string(name='ClassificationName'),
        }
      ](name='ThirdClassification')
      }(name='ThirdClassification'),
      totalPrice?: float(name='TotalPrice', example='100.0'),
      trademarkIcon?: string(name='TrademarkIcon', example='https://trade-mark-user-upload.oss-cn-beijing.aliyuncs.com/1219541161213057/icon/6xreg1ooy9a.jpg?Expires=1570955079&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=Qdyo6vrdAaktFB6iEumnXO2plME%3D'),
      trademarkName?: string(name='TrademarkName'),
      trademarkNumber?: string(name='TrademarkNumber', example='345678'),
      updateTime?: long(name='UpdateTime', example='1568276757000'),
      userId?: string(name='UserId', example='1219541161213057'),
    }
  ](name='TrademarkApplication')
  }(name='TrademarkApplications'),
}

model ListTrademarkApplicationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrademarkApplicationsResponseBody(name='body'),
}

async function listTrademarkApplicationsWithOptions(request: ListTrademarkApplicationsRequest, runtime: Util.RuntimeOptions): ListTrademarkApplicationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.applicationStatus)) {
    query['ApplicationStatus'] = request.applicationStatus;
  }
  if (!Util.isUnset(request.applicationType)) {
    query['ApplicationType'] = request.applicationType;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.createTimeLeft)) {
    query['CreateTimeLeft'] = request.createTimeLeft;
  }
  if (!Util.isUnset(request.createTimeRight)) {
    query['CreateTimeRight'] = request.createTimeRight;
  }
  if (!Util.isUnset(request.flag)) {
    query['Flag'] = request.flag;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!Util.isUnset(request.queryVoucherOrderDoneFlag)) {
    query['QueryVoucherOrderDoneFlag'] = request.queryVoucherOrderDoneFlag;
  }
  if (!Util.isUnset(request.queryVoucherOrderFlag)) {
    query['QueryVoucherOrderFlag'] = request.queryVoucherOrderFlag;
  }
  if (!Util.isUnset(request.sortFiled)) {
    query['SortFiled'] = request.sortFiled;
  }
  if (!Util.isUnset(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!Util.isUnset(request.supplementStatus)) {
    query['SupplementStatus'] = request.supplementStatus;
  }
  if (!Util.isUnset(request.trademarkName)) {
    query['TrademarkName'] = request.trademarkName;
  }
  if (!Util.isUnset(request.trademarkNumber)) {
    query['TrademarkNumber'] = request.trademarkNumber;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTrademarkApplications',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTrademarkApplications(request: ListTrademarkApplicationsRequest): ListTrademarkApplicationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTrademarkApplicationsWithOptions(request, runtime);
}

model ListTrademarkSearchForInnerRequest {
  applyBeginTime?: string(name='ApplyBeginTime'),
  applyEndTime?: string(name='ApplyEndTime'),
  classification?: string(name='Classification'),
  ifPrecision?: boolean(name='IfPrecision'),
  keyword?: string(name='Keyword'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  product?: string(name='Product'),
  searchPreference?: string(name='SearchPreference'),
  searchType?: string(name='SearchType'),
  status?: string(name='Status'),
  umid?: string(name='Umid'),
  userId?: string(name='UserId'),
}

model ListTrademarkSearchForInnerResponseBody = {
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  products?: [ string ](name='Products'),
  requestId?: string(name='RequestId'),
  totalCount?: string(name='TotalCount'),
  trademarkSearchContents?: [ 
    {
      applyDate?: string(name='ApplyDate'),
      classification?: string(name='Classification'),
      exclusiveDateLimit?: string(name='ExclusiveDateLimit'),
      id?: long(name='Id'),
      image?: string(name='Image'),
      lastProcedureStatus?: string(name='LastProcedureStatus'),
      name?: string(name='Name'),
      nameCharSection?: string(name='NameCharSection'),
      nameOrigin?: string(name='NameOrigin'),
      nameSimplifiedChinese?: string(name='NameSimplifiedChinese'),
      nameSort?: string(name='NameSort'),
      onSale?: string(name='OnSale'),
      ownerAddress?: string(name='OwnerAddress'),
      ownerEnAddress?: string(name='OwnerEnAddress'),
      ownerEnName?: string(name='OwnerEnName'),
      ownerName?: string(name='OwnerName'),
      preAnnDate?: string(name='PreAnnDate'),
      preAnnNum?: string(name='PreAnnNum'),
      product?: string(name='Product'),
      productDel?: [ string ](name='ProductDel'),
      productDescription?: string(name='ProductDescription'),
      regAnnNum?: string(name='RegAnnNum'),
      registrationNumber?: string(name='RegistrationNumber'),
      share?: string(name='Share'),
      similarGroupDel?: [ string ](name='SimilarGroupDel'),
      uid?: string(name='Uid'),
      wellKnow?: string(name='WellKnow'),
    }
  ](name='TrademarkSearchContents'),
}

model ListTrademarkSearchForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrademarkSearchForInnerResponseBody(name='body'),
}

async function listTrademarkSearchForInnerWithOptions(request: ListTrademarkSearchForInnerRequest, runtime: Util.RuntimeOptions): ListTrademarkSearchForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applyBeginTime)) {
    query['ApplyBeginTime'] = request.applyBeginTime;
  }
  if (!Util.isUnset(request.applyEndTime)) {
    query['ApplyEndTime'] = request.applyEndTime;
  }
  if (!Util.isUnset(request.classification)) {
    query['Classification'] = request.classification;
  }
  if (!Util.isUnset(request.ifPrecision)) {
    query['IfPrecision'] = request.ifPrecision;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.searchPreference)) {
    query['SearchPreference'] = request.searchPreference;
  }
  if (!Util.isUnset(request.searchType)) {
    query['SearchType'] = request.searchType;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTrademarkSearchForInner',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listTrademarkSearchForInner(request: ListTrademarkSearchForInnerRequest): ListTrademarkSearchForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTrademarkSearchForInnerWithOptions(request, runtime);
}

model PutMeasureDataRequest {
  bizType?: string(name='BizType'),
  data?: string(name='Data'),
  dataType?: string(name='DataType'),
  endTime?: string(name='EndTime'),
  startTime?: string(name='StartTime'),
}

model PutMeasureDataResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model PutMeasureDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutMeasureDataResponseBody(name='body'),
}

async function putMeasureDataWithOptions(request: PutMeasureDataRequest, runtime: Util.RuntimeOptions): PutMeasureDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.data)) {
    body['Data'] = request.data;
  }
  if (!Util.isUnset(request.dataType)) {
    body['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PutMeasureData',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putMeasureData(request: PutMeasureDataRequest): PutMeasureDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMeasureDataWithOptions(request, runtime);
}

model PutMeasureReadyFlagRequest {
  bizType?: string(name='BizType'),
  dataType?: string(name='DataType'),
  endTime?: string(name='EndTime'),
  readyFlag?: string(name='ReadyFlag'),
  startTime?: string(name='StartTime'),
}

model PutMeasureReadyFlagResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model PutMeasureReadyFlagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutMeasureReadyFlagResponseBody(name='body'),
}

async function putMeasureReadyFlagWithOptions(request: PutMeasureReadyFlagRequest, runtime: Util.RuntimeOptions): PutMeasureReadyFlagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.readyFlag)) {
    query['ReadyFlag'] = request.readyFlag;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMeasureReadyFlag',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putMeasureReadyFlag(request: PutMeasureReadyFlagRequest): PutMeasureReadyFlagResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMeasureReadyFlagWithOptions(request, runtime);
}

model QueryActivityItemsRequest {
  activityId?: int32(name='ActivityId'),
  extendInfo?: string(name='ExtendInfo'),
  floorIndex?: int32(name='FloorIndex', example='0'),
  mock?: boolean(name='Mock'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  refresh?: boolean(name='Refresh'),
  umId?: string(name='UmId'),
}

model QueryActivityItemsResponseBody = {
  module?: {
    data?: string(name='Data'),
    floorDisplayInfos?: {
      floor?: [ 
      {
        icon?: string(name='Icon'),
        index?: int32(name='Index'),
        name?: string(name='Name'),
        subTitles?: {
          subFloor?: [ 
          {
            icon?: string(name='Icon'),
            name?: string(name='Name'),
            title?: string(name='Title'),
            value?: string(name='Value'),
          }
        ](name='subFloor')
        }(name='SubTitles'),
        title?: string(name='Title'),
      }
    ](name='floor')
    }(name='FloorDisplayInfos'),
    floorItems?: string(name='FloorItems'),
  }(name='Module'),
}

model QueryActivityItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryActivityItemsResponseBody(name='body'),
}

async function queryActivityItemsWithOptions(request: QueryActivityItemsRequest, runtime: Util.RuntimeOptions): QueryActivityItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activityId)) {
    query['ActivityId'] = request.activityId;
  }
  if (!Util.isUnset(request.extendInfo)) {
    query['ExtendInfo'] = request.extendInfo;
  }
  if (!Util.isUnset(request.floorIndex)) {
    query['FloorIndex'] = request.floorIndex;
  }
  if (!Util.isUnset(request.mock)) {
    query['Mock'] = request.mock;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.refresh)) {
    query['Refresh'] = request.refresh;
  }
  if (!Util.isUnset(request.umId)) {
    query['UmId'] = request.umId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryActivityItems',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryActivityItems(request: QueryActivityItemsRequest): QueryActivityItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryActivityItemsWithOptions(request, runtime);
}

model QueryAliyunUidRequest {
  tbUid?: string(name='TbUid'),
}

model QueryAliyunUidResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  uid?: string(name='Uid'),
}

model QueryAliyunUidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAliyunUidResponseBody(name='body'),
}

async function queryAliyunUidWithOptions(request: QueryAliyunUidRequest, runtime: Util.RuntimeOptions): QueryAliyunUidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.tbUid)) {
    query['TbUid'] = request.tbUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAliyunUid',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAliyunUid(request: QueryAliyunUidRequest): QueryAliyunUidResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAliyunUidWithOptions(request, runtime);
}

model QueryDetailItemRequest {
  detailConvertType?: string(name='DetailConvertType'),
  detailId?: string(name='DetailId'),
  detailType?: string(name='DetailType'),
  mock?: boolean(name='Mock'),
}

model QueryDetailItemResponseBody = {
  module?: {
    attributes?: {
      attribute?: [ 
      {
        name?: string(name='Name'),
        title?: string(name='Title'),
        value?: string(name='Value'),
      }
    ](name='attribute')
    }(name='Attributes'),
    detailDescription?: string(name='DetailDescription'),
    detailObjectJson?: string(name='DetailObjectJson'),
    detailPagePicUrl?: string(name='DetailPagePicUrl'),
    detailPicUrl?: {
      picUlr?: [ string ](name='picUlr')
    }(name='DetailPicUrl'),
    label?: string(name='Label'),
    mainPicUrl?: string(name='MainPicUrl'),
    title?: string(name='Title'),
    type?: string(name='Type'),
  }(name='Module'),
}

model QueryDetailItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDetailItemResponseBody(name='body'),
}

async function queryDetailItemWithOptions(request: QueryDetailItemRequest, runtime: Util.RuntimeOptions): QueryDetailItemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.detailConvertType)) {
    query['DetailConvertType'] = request.detailConvertType;
  }
  if (!Util.isUnset(request.detailId)) {
    query['DetailId'] = request.detailId;
  }
  if (!Util.isUnset(request.detailType)) {
    query['DetailType'] = request.detailType;
  }
  if (!Util.isUnset(request.mock)) {
    query['Mock'] = request.mock;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDetailItem',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryDetailItem(request: QueryDetailItemRequest): QueryDetailItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDetailItemWithOptions(request, runtime);
}

model QueryRemainResourcesRequest {
  bizType?: string(name='BizType'),
}

model QueryRemainResourcesResponseBody = {
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
}

model QueryRemainResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRemainResourcesResponseBody(name='body'),
}

async function queryRemainResourcesWithOptions(request: QueryRemainResourcesRequest, runtime: Util.RuntimeOptions): QueryRemainResourcesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRemainResources',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRemainResources(request: QueryRemainResourcesRequest): QueryRemainResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRemainResourcesWithOptions(request, runtime);
}

model RefuseSupplementRequest {
  supplementId?: long(name='SupplementId', example='1'),
}

model RefuseSupplementResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='12244B90-2786-4C63-9FE9-34AE9E508857'),
  success?: boolean(name='Success', example='true'),
}

model RefuseSupplementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefuseSupplementResponseBody(name='body'),
}

async function refuseSupplementWithOptions(request: RefuseSupplementRequest, runtime: Util.RuntimeOptions): RefuseSupplementResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.supplementId)) {
    query['SupplementId'] = request.supplementId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefuseSupplement',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refuseSupplement(request: RefuseSupplementRequest): RefuseSupplementResponse {
  var runtime = new Util.RuntimeOptions{};
  return refuseSupplementWithOptions(request, runtime);
}

model RejectExpertSolutionRequest {
  bizId?: string(name='BizId'),
  note?: string(name='Note'),
}

model RejectExpertSolutionResponseBody = {
  requestId?: string(name='RequestId'),
}

model RejectExpertSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RejectExpertSolutionResponseBody(name='body'),
}

async function rejectExpertSolutionWithOptions(request: RejectExpertSolutionRequest, runtime: Util.RuntimeOptions): RejectExpertSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.note)) {
    query['Note'] = request.note;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RejectExpertSolution',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function rejectExpertSolution(request: RejectExpertSolutionRequest): RejectExpertSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return rejectExpertSolutionWithOptions(request, runtime);
}

model RemoveApplicantRequest {
  applicantId?: long(name='ApplicantId', example='234567'),
}

model RemoveApplicantResponseBody = {
  code?: string(name='Code', example='success'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='88C7CDCD-1E99-47FB-B781-8156F14B6A91'),
  success?: boolean(name='Success', example='true'),
}

model RemoveApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveApplicantResponseBody(name='body'),
}

async function removeApplicantWithOptions(request: RemoveApplicantRequest, runtime: Util.RuntimeOptions): RemoveApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeApplicant(request: RemoveApplicantRequest): RemoveApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeApplicantWithOptions(request, runtime);
}

model SaveSearchConditionRequest {
  conditionContent?: string(name='ConditionContent'),
  sessionId?: string(name='SessionId'),
  tagName?: string(name='TagName'),
  type?: int32(name='Type'),
  umid?: string(name='Umid'),
}

model SaveSearchConditionResponseBody = {
  code?: string(name='Code'),
  conditionContent?: string(name='ConditionContent'),
  conditionId?: long(name='ConditionId'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  sessionId?: string(name='SessionId'),
  success?: boolean(name='Success'),
  tagName?: string(name='TagName'),
  type?: int32(name='Type'),
  umid?: string(name='Umid'),
  userId?: long(name='UserId'),
}

model SaveSearchConditionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveSearchConditionResponseBody(name='body'),
}

async function saveSearchConditionWithOptions(request: SaveSearchConditionRequest, runtime: Util.RuntimeOptions): SaveSearchConditionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.conditionContent)) {
    body['ConditionContent'] = request.conditionContent;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tagName)) {
    body['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.umid)) {
    body['Umid'] = request.umid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SaveSearchCondition',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveSearchCondition(request: SaveSearchConditionRequest): SaveSearchConditionResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveSearchConditionWithOptions(request, runtime);
}

model SaveTemporaryApplicantRequest {
  address?: string(name='Address'),
  applicantId?: long(name='ApplicantId'),
  businessLicenceOssKey?: string(name='BusinessLicenceOssKey'),
  cardNumber?: string(name='CardNumber'),
  city?: string(name='City'),
  completeApplicant?: boolean(name='CompleteApplicant'),
  contactAddress?: string(name='ContactAddress'),
  contactCity?: string(name='ContactCity'),
  contactCounty?: string(name='ContactCounty'),
  contactDistrict?: string(name='ContactDistrict'),
  contactEmail?: string(name='ContactEmail'),
  contactName?: string(name='ContactName'),
  contactNumber?: string(name='ContactNumber'),
  contactProvince?: string(name='ContactProvince'),
  contactZipCode?: string(name='ContactZipCode'),
  country?: string(name='Country'),
  EAddress?: string(name='EAddress'),
  EName?: string(name='EName'),
  idCardOssKey?: string(name='IdCardOssKey'),
  legalNoticeOssKey?: string(name='LegalNoticeOssKey'),
  loaOssKey?: string(name='LoaOssKey'),
  name?: string(name='Name'),
  passportOssKey?: string(name='PassportOssKey'),
  principalName?: int32(name='PrincipalName'),
  province?: string(name='Province'),
  region?: string(name='Region'),
  town?: string(name='Town'),
  type?: string(name='Type'),
}

model SaveTemporaryApplicantResponseBody = {
  applicantId?: long(name='ApplicantId'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SaveTemporaryApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveTemporaryApplicantResponseBody(name='body'),
}

async function saveTemporaryApplicantWithOptions(request: SaveTemporaryApplicantRequest, runtime: Util.RuntimeOptions): SaveTemporaryApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  if (!Util.isUnset(request.businessLicenceOssKey)) {
    query['BusinessLicenceOssKey'] = request.businessLicenceOssKey;
  }
  if (!Util.isUnset(request.cardNumber)) {
    query['CardNumber'] = request.cardNumber;
  }
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.completeApplicant)) {
    query['CompleteApplicant'] = request.completeApplicant;
  }
  if (!Util.isUnset(request.contactAddress)) {
    query['ContactAddress'] = request.contactAddress;
  }
  if (!Util.isUnset(request.contactCity)) {
    query['ContactCity'] = request.contactCity;
  }
  if (!Util.isUnset(request.contactCounty)) {
    query['ContactCounty'] = request.contactCounty;
  }
  if (!Util.isUnset(request.contactDistrict)) {
    query['ContactDistrict'] = request.contactDistrict;
  }
  if (!Util.isUnset(request.contactEmail)) {
    query['ContactEmail'] = request.contactEmail;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.contactNumber)) {
    query['ContactNumber'] = request.contactNumber;
  }
  if (!Util.isUnset(request.contactProvince)) {
    query['ContactProvince'] = request.contactProvince;
  }
  if (!Util.isUnset(request.contactZipCode)) {
    query['ContactZipCode'] = request.contactZipCode;
  }
  if (!Util.isUnset(request.country)) {
    query['Country'] = request.country;
  }
  if (!Util.isUnset(request.EAddress)) {
    query['EAddress'] = request.EAddress;
  }
  if (!Util.isUnset(request.EName)) {
    query['EName'] = request.EName;
  }
  if (!Util.isUnset(request.idCardOssKey)) {
    query['IdCardOssKey'] = request.idCardOssKey;
  }
  if (!Util.isUnset(request.legalNoticeOssKey)) {
    query['LegalNoticeOssKey'] = request.legalNoticeOssKey;
  }
  if (!Util.isUnset(request.loaOssKey)) {
    query['LoaOssKey'] = request.loaOssKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.passportOssKey)) {
    query['PassportOssKey'] = request.passportOssKey;
  }
  if (!Util.isUnset(request.principalName)) {
    query['PrincipalName'] = request.principalName;
  }
  if (!Util.isUnset(request.province)) {
    query['Province'] = request.province;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.town)) {
    query['Town'] = request.town;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SaveTemporaryApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveTemporaryApplicant(request: SaveTemporaryApplicantRequest): SaveTemporaryApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveTemporaryApplicantWithOptions(request, runtime);
}

model SearchItemsRequest {
  excludedTags?: string(name='ExcludedTags'),
  excludedUids?: string(name='ExcludedUids'),
  feedsType?: boolean(name='FeedsType'),
  intCls?: string(name='IntCls'),
  keywords?: string(name='Keywords'),
  mock?: boolean(name='Mock'),
  pageIndex?: int32(name='PageIndex'),
  pageSize?: int32(name='PageSize'),
  priceLeft?: string(name='PriceLeft'),
  priceRight?: string(name='PriceRight'),
  products?: string(name='Products'),
  registerNumber?: string(name='RegisterNumber'),
  sort?: string(name='Sort'),
  sortType?: int32(name='SortType'),
  tags?: string(name='Tags'),
  trademarkNameLength?: int32(name='TrademarkNameLength'),
  trademarkNameType?: string(name='TrademarkNameType'),
  umId?: string(name='UmId'),
}

model SearchItemsResponseBody = {
  module?: {
    currentPageNum?: int32(name='CurrentPageNum'),
    date?: {
      item?: [ 
      {
        detailViewObjectSourceDatum?: string(name='DetailViewObjectSourceDatum'),
        detailViewObjectSourceType?: string(name='DetailViewObjectSourceType'),
      }
    ](name='item')
    }(name='Date'),
    pageSize?: int32(name='PageSize'),
    totalItemNum?: int32(name='TotalItemNum'),
    totalPageNum?: int32(name='TotalPageNum'),
  }(name='Module'),
}

model SearchItemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchItemsResponseBody(name='body'),
}

async function searchItemsWithOptions(request: SearchItemsRequest, runtime: Util.RuntimeOptions): SearchItemsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.excludedTags)) {
    query['ExcludedTags'] = request.excludedTags;
  }
  if (!Util.isUnset(request.excludedUids)) {
    query['ExcludedUids'] = request.excludedUids;
  }
  if (!Util.isUnset(request.feedsType)) {
    query['FeedsType'] = request.feedsType;
  }
  if (!Util.isUnset(request.intCls)) {
    query['IntCls'] = request.intCls;
  }
  if (!Util.isUnset(request.keywords)) {
    query['Keywords'] = request.keywords;
  }
  if (!Util.isUnset(request.mock)) {
    query['Mock'] = request.mock;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.priceLeft)) {
    query['PriceLeft'] = request.priceLeft;
  }
  if (!Util.isUnset(request.priceRight)) {
    query['PriceRight'] = request.priceRight;
  }
  if (!Util.isUnset(request.products)) {
    query['Products'] = request.products;
  }
  if (!Util.isUnset(request.registerNumber)) {
    query['RegisterNumber'] = request.registerNumber;
  }
  if (!Util.isUnset(request.sort)) {
    query['Sort'] = request.sort;
  }
  if (!Util.isUnset(request.sortType)) {
    query['SortType'] = request.sortType;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.trademarkNameLength)) {
    query['TrademarkNameLength'] = request.trademarkNameLength;
  }
  if (!Util.isUnset(request.trademarkNameType)) {
    query['TrademarkNameType'] = request.trademarkNameType;
  }
  if (!Util.isUnset(request.umId)) {
    query['UmId'] = request.umId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchItems',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function searchItems(request: SearchItemsRequest): SearchItemsResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchItemsWithOptions(request, runtime);
}

model SearchSimilarityRequest {
  classifications?: map[string]any(name='Classifications'),
  limit?: int32(name='Limit'),
  nameUriList?: [ 
    {
      name?: string(name='Name'),
      uri?: string(name='Uri'),
    }
  ](name='NameUriList'),
  searchType?: string(name='SearchType'),
  showDetail?: boolean(name='ShowDetail'),
  similarGroups?: map[string]any(name='SimilarGroups'),
  sorter?: string(name='Sorter'),
  umid?: string(name='Umid'),
}

model SearchSimilarityShrinkRequest {
  classificationsShrink?: string(name='Classifications'),
  limit?: int32(name='Limit'),
  nameUriList?: [ 
    {
      name?: string(name='Name'),
      uri?: string(name='Uri'),
    }
  ](name='NameUriList'),
  searchType?: string(name='SearchType'),
  showDetail?: boolean(name='ShowDetail'),
  similarGroupsShrink?: string(name='SimilarGroups'),
  sorter?: string(name='Sorter'),
  umid?: string(name='Umid'),
}

model SearchSimilarityResponseBody = {
  dataList?: [ 
    {
      classificationSimilarityList?: [ 
        {
          classification?: int32(name='Classification'),
          classificationName?: string(name='ClassificationName'),
          rate?: int32(name='Rate'),
          similarGroupList?: [ 
            {
              detailList?: [ 
                {
                  code?: string(name='Code'),
                  name?: string(name='Name'),
                  rate?: int32(name='Rate'),
                  tmNumber?: string(name='TmNumber'),
                  uid?: string(name='Uid'),
                  uri?: string(name='Uri'),
                }
              ](name='DetailList'),
              rate?: int32(name='Rate'),
              similarGroup?: string(name='SimilarGroup'),
              similarGroupName?: string(name='SimilarGroupName'),
            }
          ](name='SimilarGroupList'),
        }
      ](name='ClassificationSimilarityList'),
      name?: string(name='Name'),
      uri?: string(name='Uri'),
    }
  ](name='DataList'),
  requestId?: string(name='RequestId'),
}

model SearchSimilarityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchSimilarityResponseBody(name='body'),
}

async function searchSimilarityWithOptions(tmpReq: SearchSimilarityRequest, runtime: Util.RuntimeOptions): SearchSimilarityResponse {
  Util.validateModel(tmpReq);
  var request = new SearchSimilarityShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.classifications)) {
    request.classificationsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.classifications, 'Classifications', 'json');
  }
  if (!Util.isUnset(tmpReq.similarGroups)) {
    request.similarGroupsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.similarGroups, 'SimilarGroups', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.classificationsShrink)) {
    query['Classifications'] = request.classificationsShrink;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.nameUriList)) {
    query['NameUriList'] = request.nameUriList;
  }
  if (!Util.isUnset(request.searchType)) {
    query['SearchType'] = request.searchType;
  }
  if (!Util.isUnset(request.showDetail)) {
    query['ShowDetail'] = request.showDetail;
  }
  if (!Util.isUnset(request.similarGroupsShrink)) {
    query['SimilarGroups'] = request.similarGroupsShrink;
  }
  if (!Util.isUnset(request.sorter)) {
    query['Sorter'] = request.sorter;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchSimilarity',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function searchSimilarity(request: SearchSimilarityRequest): SearchSimilarityResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchSimilarityWithOptions(request, runtime);
}

model SearchSimilarityListRequest {
  classifications?: map[string]any(name='Classifications'),
  name?: string(name='Name'),
  orderId?: string(name='OrderId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  similarGroups?: map[string]any(name='SimilarGroups'),
  status?: int32(name='Status'),
  successSearchType?: string(name='SuccessSearchType'),
  umid?: string(name='Umid'),
  uri?: string(name='Uri'),
}

model SearchSimilarityListShrinkRequest {
  classificationsShrink?: string(name='Classifications'),
  name?: string(name='Name'),
  orderId?: string(name='OrderId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  similarGroupsShrink?: string(name='SimilarGroups'),
  status?: int32(name='Status'),
  successSearchType?: string(name='SuccessSearchType'),
  umid?: string(name='Umid'),
  uri?: string(name='Uri'),
}

model SearchSimilarityListResponseBody = {
  data?: [ 
    {
      applyDate?: string(name='ApplyDate'),
      classification?: string(name='Classification'),
      exclusiveDateLimit?: string(name='ExclusiveDateLimit'),
      id?: long(name='Id'),
      image?: string(name='Image'),
      lastProcedureStatus?: string(name='LastProcedureStatus'),
      name?: string(name='Name'),
      onSale?: int32(name='OnSale'),
      ownerAddress?: string(name='OwnerAddress'),
      ownerEnAddress?: string(name='OwnerEnAddress'),
      ownerEnName?: string(name='OwnerEnName'),
      ownerName?: string(name='OwnerName'),
      preAnnDate?: string(name='PreAnnDate'),
      preAnnNum?: string(name='PreAnnNum'),
      product?: string(name='Product'),
      productDesc?: string(name='ProductDesc'),
      regAnnDate?: string(name='RegAnnDate'),
      regAnnNum?: string(name='RegAnnNum'),
      registrationNumber?: string(name='RegistrationNumber'),
      share?: string(name='Share'),
      status?: string(name='Status'),
      uid?: string(name='Uid'),
    }
  ](name='Data'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model SearchSimilarityListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchSimilarityListResponseBody(name='body'),
}

async function searchSimilarityListWithOptions(tmpReq: SearchSimilarityListRequest, runtime: Util.RuntimeOptions): SearchSimilarityListResponse {
  Util.validateModel(tmpReq);
  var request = new SearchSimilarityListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.classifications)) {
    request.classificationsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.classifications, 'Classifications', 'json');
  }
  if (!Util.isUnset(tmpReq.similarGroups)) {
    request.similarGroupsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.similarGroups, 'SimilarGroups', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.classificationsShrink)) {
    query['Classifications'] = request.classificationsShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.similarGroupsShrink)) {
    query['SimilarGroups'] = request.similarGroupsShrink;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.successSearchType)) {
    query['SuccessSearchType'] = request.successSearchType;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  if (!Util.isUnset(request.uri)) {
    query['Uri'] = request.uri;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchSimilarityList',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function searchSimilarityList(request: SearchSimilarityListRequest): SearchSimilarityListResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchSimilarityListWithOptions(request, runtime);
}

model SendMessageToUserRequest {
  receiverNickName?: string(name='ReceiverNickName'),
  senderNickName?: string(name='SenderNickName'),
  templateData?: map[string]any(name='TemplateData'),
  templateId?: string(name='TemplateId'),
}

model SendMessageToUserShrinkRequest {
  receiverNickName?: string(name='ReceiverNickName'),
  senderNickName?: string(name='SenderNickName'),
  templateDataShrink?: string(name='TemplateData'),
  templateId?: string(name='TemplateId'),
}

model SendMessageToUserResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SendMessageToUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendMessageToUserResponseBody(name='body'),
}

async function sendMessageToUserWithOptions(tmpReq: SendMessageToUserRequest, runtime: Util.RuntimeOptions): SendMessageToUserResponse {
  Util.validateModel(tmpReq);
  var request = new SendMessageToUserShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.templateData)) {
    request.templateDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.templateData, 'TemplateData', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.receiverNickName)) {
    query['ReceiverNickName'] = request.receiverNickName;
  }
  if (!Util.isUnset(request.senderNickName)) {
    query['SenderNickName'] = request.senderNickName;
  }
  if (!Util.isUnset(request.templateDataShrink)) {
    query['TemplateData'] = request.templateDataShrink;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendMessageToUser',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendMessageToUser(request: SendMessageToUserRequest): SendMessageToUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendMessageToUserWithOptions(request, runtime);
}

model SubmitSupplementRequest {
  content?: string(name='Content'),
  supplementId?: long(name='SupplementId', example='1'),
  userFiles?: map[string]any(name='UserFiles'),
}

model SubmitSupplementShrinkRequest {
  content?: string(name='Content'),
  supplementId?: long(name='SupplementId', example='1'),
  userFilesShrink?: string(name='UserFiles'),
}

model SubmitSupplementResponseBody = {
  code?: string(name='Code', example='SUPPLEMENT_STATUS_ERROR'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='adfghjk-123456-234dd-asdfasdf'),
  success?: boolean(name='Success', example='false'),
}

model SubmitSupplementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitSupplementResponseBody(name='body'),
}

/**
  * ***
  *
  * @param tmpReq SubmitSupplementRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return SubmitSupplementResponse
 */
async function submitSupplementWithOptions(tmpReq: SubmitSupplementRequest, runtime: Util.RuntimeOptions): SubmitSupplementResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitSupplementShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.userFiles)) {
    request.userFilesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userFiles, 'UserFiles', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.supplementId)) {
    query['SupplementId'] = request.supplementId;
  }
  if (!Util.isUnset(request.userFilesShrink)) {
    query['UserFiles'] = request.userFilesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitSupplement',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ***
  *
  * @param request SubmitSupplementRequest
  * @return SubmitSupplementResponse
 */
async function submitSupplement(request: SubmitSupplementRequest): SubmitSupplementResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitSupplementWithOptions(request, runtime);
}

model UpdateApplicantRequest {
  address?: string(name='Address'),
  applicantId?: long(name='ApplicantId', example='123456'),
  applicantName?: string(name='ApplicantName'),
  authorizationOssKey?: string(name='AuthorizationOssKey', example='1234567/xxxx.jpg'),
  businessLicenceOssKey?: string(name='BusinessLicenceOssKey', example='1234567/xxxx.jpg'),
  cardNumber?: string(name='CardNumber', example='1234567890'),
  contactAddress?: string(name='ContactAddress'),
  contactCity?: string(name='ContactCity'),
  contactCounty?: string(name='ContactCounty'),
  contactDistrict?: string(name='ContactDistrict'),
  contactEmail?: string(name='ContactEmail', example='test123@alibaba.com'),
  contactName?: string(name='ContactName'),
  contactNumber?: string(name='ContactNumber', example='123456789'),
  contactProvince?: string(name='ContactProvince'),
  contactZipcode?: string(name='ContactZipcode', example='100000'),
  EAddress?: string(name='EAddress', example='xxxxxxxxxx'),
  EName?: string(name='EName', example='zhang san'),
  idCardName?: string(name='IdCardName'),
  idCardNumber?: string(name='IdCardNumber'),
  idCardOssKey?: string(name='IdCardOssKey', example='1234567/xxxx.jpg'),
  legalNoticeOssKey?: string(name='LegalNoticeOssKey', example='1234567/xxxx.jpg'),
  passportOssKey?: string(name='PassportOssKey', example='1234567/xxxx.jpg'),
  personalType?: long(name='PersonalType'),
  province?: string(name='Province'),
}

model UpdateApplicantResponseBody = {
  requestId?: string(name='RequestId', example='40D24883-BB1B-4C2B-BC93-4F9DEB8F40FA'),
  success?: boolean(name='Success', example='true'),
}

model UpdateApplicantResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateApplicantResponseBody(name='body'),
}

async function updateApplicantWithOptions(request: UpdateApplicantRequest, runtime: Util.RuntimeOptions): UpdateApplicantResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.applicantId)) {
    query['ApplicantId'] = request.applicantId;
  }
  if (!Util.isUnset(request.applicantName)) {
    query['ApplicantName'] = request.applicantName;
  }
  if (!Util.isUnset(request.authorizationOssKey)) {
    query['AuthorizationOssKey'] = request.authorizationOssKey;
  }
  if (!Util.isUnset(request.businessLicenceOssKey)) {
    query['BusinessLicenceOssKey'] = request.businessLicenceOssKey;
  }
  if (!Util.isUnset(request.cardNumber)) {
    query['CardNumber'] = request.cardNumber;
  }
  if (!Util.isUnset(request.contactAddress)) {
    query['ContactAddress'] = request.contactAddress;
  }
  if (!Util.isUnset(request.contactCity)) {
    query['ContactCity'] = request.contactCity;
  }
  if (!Util.isUnset(request.contactCounty)) {
    query['ContactCounty'] = request.contactCounty;
  }
  if (!Util.isUnset(request.contactDistrict)) {
    query['ContactDistrict'] = request.contactDistrict;
  }
  if (!Util.isUnset(request.contactEmail)) {
    query['ContactEmail'] = request.contactEmail;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.contactNumber)) {
    query['ContactNumber'] = request.contactNumber;
  }
  if (!Util.isUnset(request.contactProvince)) {
    query['ContactProvince'] = request.contactProvince;
  }
  if (!Util.isUnset(request.contactZipcode)) {
    query['ContactZipcode'] = request.contactZipcode;
  }
  if (!Util.isUnset(request.EAddress)) {
    query['EAddress'] = request.EAddress;
  }
  if (!Util.isUnset(request.EName)) {
    query['EName'] = request.EName;
  }
  if (!Util.isUnset(request.idCardName)) {
    query['IdCardName'] = request.idCardName;
  }
  if (!Util.isUnset(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!Util.isUnset(request.idCardOssKey)) {
    query['IdCardOssKey'] = request.idCardOssKey;
  }
  if (!Util.isUnset(request.legalNoticeOssKey)) {
    query['LegalNoticeOssKey'] = request.legalNoticeOssKey;
  }
  if (!Util.isUnset(request.passportOssKey)) {
    query['PassportOssKey'] = request.passportOssKey;
  }
  if (!Util.isUnset(request.personalType)) {
    query['PersonalType'] = request.personalType;
  }
  if (!Util.isUnset(request.province)) {
    query['Province'] = request.province;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateApplicant',
    version = '2019-09-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateApplicant(request: UpdateApplicantRequest): UpdateApplicantResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateApplicantWithOptions(request, runtime);
}

